MCPcopy Create free account
hub / github.com/prometheus/prometheus / TestReleaseNoninternedString

Function TestReleaseNoninternedString

storage/remote/queue_manager_test.go:697–717  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

695}
696
697func TestReleaseNoninternedString(t *testing.T) {
698 for _, protoMsg := range []remoteapi.WriteMessageType{remoteapi.WriteV1MessageType, remoteapi.WriteV2MessageType} {
699 t.Run(fmt.Sprint(protoMsg), func(t *testing.T) {
700 _, m := newTestClientAndQueueManager(t, defaultFlushDeadline, protoMsg)
701 m.Start()
702 defer m.Stop()
703 for i := 1; i < 1000; i++ {
704 m.StoreSeries([]record.RefSeries{
705 {
706 Ref: chunks.HeadSeriesRef(i),
707 Labels: labels.FromStrings("asdf", strconv.Itoa(i)),
708 },
709 }, 0)
710 m.SeriesReset(1)
711 }
712
713 metric := client_testutil.ToFloat64(noReferenceReleases)
714 require.Equal(t, 0.0, metric, "expected there to be no calls to release for strings that were not already interned: %d", int(metric))
715 })
716 }
717}
718
719func TestShouldReshard(t *testing.T) {
720 type testcase struct {

Callers

nothing calls this directly

Calls 8

HeadSeriesRefTypeAlias · 0.92
FromStringsFunction · 0.92
RunMethod · 0.65
StoreSeriesMethod · 0.65
SeriesResetMethod · 0.65
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…