Skip to content

Commit

Permalink
dev.new-wal merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham committed Oct 3, 2024
2 parents 46e1764 + 20c1a83 commit 1e12b5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build !race

package network

import (
Expand Down Expand Up @@ -59,7 +57,9 @@ func TestUpdatingConfig(t *testing.T) {
defer goleak.VerifyNone(t)

recordsFound := atomic.Uint32{}
lastBatchSize := atomic.Uint32{}
svr := httptest.NewServer(handler(t, http.StatusOK, func(wr *prompb.WriteRequest) {
lastBatchSize.Store(uint32(len(wr.Timeseries)))
recordsFound.Add(uint32(len(wr.Timeseries)))
}))

Expand Down Expand Up @@ -98,8 +98,7 @@ func TestUpdatingConfig(t *testing.T) {
return recordsFound.Load() == 1_000
}, 10*time.Second, 1*time.Second, "record count should be 1000 but is %d", recordsFound.Load())

require.Truef(t, wr.(*manager).cfg.BatchCount == 100, "batch_count should be 100 but is %d", wr.(*manager).cfg.BatchCount)

require.Truef(t, lastBatchSize.Load() == 100, "batch_count should be 100 but is %d", lastBatchSize.Load())
}

func TestRetry(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type SeriesGroup struct {
Metadata []*TimeSeriesBinary
}

// TimeSeriesBinary is an optimized format for handling metrics and metadata. It should never be instantiated directly
// but instead use GetTimeSeriesFromPool and PutTimeSeriesSliceIntoPool. This allows us to reuse these objects and avoid
// allocations.
type TimeSeriesBinary struct {
// Labels are not serialized to msgp, instead we store separately a dictionary of strings and use `LabelNames` and `LabelValues` to refer to the dictionary by ID.
Labels labels.Labels `msg:"-"`
Expand Down

0 comments on commit 1e12b5e

Please sign in to comment.