mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
Small refactor: use clearer name formatSeriesSetLabelsToJSON
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
89b92f7880
commit
11cf858166
3 changed files with 3 additions and 3 deletions
|
|
@ -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)))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue