diff --git a/src/aggregator/aggregator/aggregator.go b/src/aggregator/aggregator/aggregator.go index 327fad2e80..53925f1906 100644 --- a/src/aggregator/aggregator/aggregator.go +++ b/src/aggregator/aggregator/aggregator.go @@ -273,7 +273,6 @@ func (agg *aggregator) AddPassthrough( if agg.electionManager.ElectionState() == FollowerState { agg.metrics.addPassthrough.ReportFollowerNoop() - agg.metrics.addPassthrough.ReportSuccess(agg.nowFn().Sub(callStart)) return nil } diff --git a/src/aggregator/aggregator/options.go b/src/aggregator/aggregator/options.go index 9c9174f98a..006801f365 100644 --- a/src/aggregator/aggregator/options.go +++ b/src/aggregator/aggregator/options.go @@ -382,6 +382,7 @@ func NewOptions() Options { shardFn: sharding.Murmur32Hash.MustShardFn(), bufferDurationBeforeShardCutover: defaultBufferDurationBeforeShardCutover, bufferDurationAfterShardCutoff: defaultBufferDurationAfterShardCutoff, + passthroughWriter: writer.NewBlackholeWriter(), entryTTL: defaultEntryTTL, entryCheckInterval: defaultEntryCheckInterval, entryCheckBatchPercent: defaultEntryCheckBatchPercent, diff --git a/src/aggregator/integration/one_client_passthru_test.go b/src/aggregator/integration/one_client_passthru_test.go index 80da611377..c63134d66e 100644 --- a/src/aggregator/integration/one_client_passthru_test.go +++ b/src/aggregator/integration/one_client_passthru_test.go @@ -23,6 +23,7 @@ package integration import ( + "reflect" "sort" "sync" "testing" @@ -140,7 +141,7 @@ func TestOneClientPassthroughMetrics(t *testing.T) { // Validate results. expected := computeExpectedPassthroughResults(t, dataset) actual := testServer.sortedResults() - require.Equal(t, expected, actual) + require.Equal(t, dedupResults(expected), dedupResults(actual)) } func computeExpectedPassthroughResults( @@ -166,3 +167,17 @@ func computeExpectedPassthroughResults( sort.Sort(byTimeIDPolicyAscending(expected)) return expected } + +func dedupResults( + results []aggregated.MetricWithStoragePolicy, +) []aggregated.MetricWithStoragePolicy { + var deduped []aggregated.MetricWithStoragePolicy + lenDeduped := 0 + for _, m := range results { + if lenDeduped == 0 || !reflect.DeepEqual(deduped[lenDeduped-1], m) { + deduped = append(deduped, m) + lenDeduped++ + } + } + return deduped +}