Small refactor: use clearer name formatSeriesSetLabelsToJSON

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2025-11-10 17:55:30 +00:00
parent 89b92f7880
commit 11cf858166
3 changed files with 3 additions and 3 deletions

View file

@ -421,7 +421,7 @@ func main() {
case tsdbDumpCmd.FullCommand():
if *dumpFormat == "seriesjson" {
os.Exit(checkErr(dumpTSDBData(ctx, *dumpPath, *dumpSandboxDirRoot, *dumpMinTime, *dumpMaxTime, *dumpMatch, formatSeriesSetToJSON)))
os.Exit(checkErr(dumpTSDBData(ctx, *dumpPath, *dumpSandboxDirRoot, *dumpMinTime, *dumpMaxTime, *dumpMatch, formatSeriesSetLabelsToJSON)))
} else {
os.Exit(checkErr(dumpTSDBData(ctx, *dumpPath, *dumpSandboxDirRoot, *dumpMinTime, *dumpMaxTime, *dumpMatch, formatSeriesSet)))
}

View file

@ -799,7 +799,7 @@ func CondensedString(ls labels.Labels) string {
return b.String()
}
func formatSeriesSetToJSON(ss storage.SeriesSet) error {
func formatSeriesSetLabelsToJSON(ss storage.SeriesSet) error {
seriesCache := make(map[string]struct{})
for ss.Next() {
series := ss.At()

View file

@ -175,7 +175,7 @@ func TestTSDBDump(t *testing.T) {
// Sort both, because Prometheus does not guarantee the output order.
require.Equal(t, sortLines(string(expectedMetrics)), sortLines(dumpedMetrics))
dumpedSeries := getDumpedSamples(t, storage.Dir(), tt.sandboxDirRoot, tt.mint, tt.maxt, tt.match, formatSeriesSetToJSON)
dumpedSeries := getDumpedSamples(t, storage.Dir(), tt.sandboxDirRoot, tt.mint, tt.maxt, tt.match, formatSeriesSetLabelsToJSON)
expectedSeries, err := os.ReadFile(tt.expectedSeries)
require.NoError(t, err)
expectedSeries = normalizeNewLine(expectedSeries)