Skip to content

Commit 5134ce1

Browse files
authored
merge the overcounting to release branch (#84)
2 parents 7a94d69 + 889d067 commit 5134ce1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/receive/handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,9 @@ func (h *Handler) gatherWriteStats(remoteWrites map[endpointReplica]map[string]t
715715
var stats tenantRequestStats = make(tenantRequestStats)
716716

717717
for er := range remoteWrites {
718+
if er.replica != 0 {
719+
continue // Skip replicated writes, only count once.
720+
}
718721
for tenant, series := range remoteWrites[er] {
719722
samples := 0
720723

pkg/receive/handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ func TestIngestorRestart(t *testing.T) {
18991899
stats, err := client.handleRequest(ctx, 0, "test", data)
19001900
require.NoError(t, err)
19011901
require.Equal(t, tenantRequestStats{
1902-
"test": requestStats{timeseries: 2, totalSamples: 2},
1902+
"test": requestStats{timeseries: 1, totalSamples: 1},
19031903
}, stats)
19041904

19051905
// close srv2 to simulate ingestor down

0 commit comments

Comments
 (0)