Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit b72ddfb

Browse files
committed
Renamed to CacheNameIndex
1 parent 98cd4c6 commit b72ddfb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/remotewrite/trend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (sink *extendedTrendSink) MapPrompb(series metrics.TimeSeries, t time.Time)
3333
labels: MapSeries(series),
3434
timestamp: t.UnixMilli(),
3535
}
36-
tg.FindNameIndex()
36+
tg.CacheNameIndex()
3737

3838
tg.Append("count", float64(sink.Count))
3939
tg.Append("sum", sink.Sum)
@@ -85,11 +85,11 @@ func (tg *trendAsGauges) Append(suffix string, v float64) {
8585
tg.series = append(tg.series, ts)
8686
}
8787

88-
// FindNameIndex finds the __name__ label's index
88+
// CacheNameIndex finds the __name__ label's index
8989
// if it is different from the most common expected case
9090
// then it caches the value.
9191
// The labels slice is expected to be sorted.
92-
func (tg *trendAsGauges) FindNameIndex() {
92+
func (tg *trendAsGauges) CacheNameIndex() {
9393
if tg.labels[0].Name == namelbl {
9494
// ixname is expected to be the first in most of the cases
9595
// the default value is already 0

pkg/remotewrite/trend_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func TestTrendAsGaugesFindIxName(t *testing.T) {
7979
lbls = append(lbls, &prompb.Label{Name: l})
8080
}
8181
tg := trendAsGauges{labels: lbls}
82-
tg.FindNameIndex()
82+
tg.CacheNameIndex()
8383
assert.Equal(t, tc.expIndex, tg.ixname)
8484
}
8585
}

0 commit comments

Comments
 (0)