Renaming

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2024-10-21 11:03:47 +02:00
parent 482bb453c6
commit 70742a64aa

View file

@ -3844,23 +3844,23 @@ metric: <
for metricsTextName, metricsText := range metricsTexts { for metricsTextName, metricsText := range metricsTexts {
for name, tc := range map[string]struct { for name, tc := range map[string]struct {
scrapeClassicHistograms bool alwaysScrapeClassicHistograms bool
convertClassicHistograms bool convertClassicHistograms bool
}{ }{
"convert with scrape": { "convert with scrape": {
scrapeClassicHistograms: true, alwaysScrapeClassicHistograms: true,
convertClassicHistograms: true, convertClassicHistograms: true,
}, },
"convert without scrape": { "convert without scrape": {
scrapeClassicHistograms: false, alwaysScrapeClassicHistograms: false,
convertClassicHistograms: true, convertClassicHistograms: true,
}, },
"scrape without convert": { "scrape without convert": {
scrapeClassicHistograms: true, alwaysScrapeClassicHistograms: true,
convertClassicHistograms: false, convertClassicHistograms: false,
}, },
"neither scrape nor convert": { "neither scrape nor convert": {
scrapeClassicHistograms: false, alwaysScrapeClassicHistograms: false,
convertClassicHistograms: false, convertClassicHistograms: false,
}, },
} { } {
@ -3870,16 +3870,16 @@ metric: <
expectedNativeHistCount = 1 expectedNativeHistCount = 1
expectCustomBuckets = false expectCustomBuckets = false
expectedClassicHistCount = 0 expectedClassicHistCount = 0
if metricsText.hasClassic && tc.scrapeClassicHistograms { if metricsText.hasClassic && tc.alwaysScrapeClassicHistograms {
expectedClassicHistCount = 1 expectedClassicHistCount = 1
} }
} else if metricsText.hasClassic { } else if metricsText.hasClassic {
switch { switch {
case tc.scrapeClassicHistograms && tc.convertClassicHistograms: case tc.alwaysScrapeClassicHistograms && tc.convertClassicHistograms:
expectedClassicHistCount = 1 expectedClassicHistCount = 1
expectedNativeHistCount = 1 expectedNativeHistCount = 1
expectCustomBuckets = true expectCustomBuckets = true
case !tc.scrapeClassicHistograms && tc.convertClassicHistograms: case !tc.alwaysScrapeClassicHistograms && tc.convertClassicHistograms:
expectedClassicHistCount = 0 expectedClassicHistCount = 0
expectedNativeHistCount = 1 expectedNativeHistCount = 1
expectCustomBuckets = true expectCustomBuckets = true
@ -3899,7 +3899,7 @@ metric: <
Scheme: "http", Scheme: "http",
ScrapeInterval: model.Duration(100 * time.Millisecond), ScrapeInterval: model.Duration(100 * time.Millisecond),
ScrapeTimeout: model.Duration(100 * time.Millisecond), ScrapeTimeout: model.Duration(100 * time.Millisecond),
ScrapeClassicHistograms: tc.scrapeClassicHistograms, AlwaysScrapeClassicHistograms: tc.alwaysScrapeClassicHistograms,
ConvertClassicHistograms: tc.convertClassicHistograms, ConvertClassicHistograms: tc.convertClassicHistograms,
} }