check for quantile vaules in TestPrometheusConverter_AddSummaryDataPoints
CI / Go tests (push) Has been cancelled Details
CI / More Go tests (push) Has been cancelled Details
CI / Go tests with previous Go version (push) Has been cancelled Details
CI / UI tests (push) Has been cancelled Details
CI / Go tests on Windows (push) Has been cancelled Details
CI / Mixins tests (push) Has been cancelled Details
CI / Build Prometheus for common architectures (0) (push) Has been cancelled Details
CI / Build Prometheus for common architectures (1) (push) Has been cancelled Details
CI / Build Prometheus for common architectures (2) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (0) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (1) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (10) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (11) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (2) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (3) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (4) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (5) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (6) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (7) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (8) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (9) (push) Has been cancelled Details
CI / Check generated parser (push) Has been cancelled Details
CI / golangci-lint (push) Has been cancelled Details
CI / fuzzing (push) Has been cancelled Details
CI / codeql (push) Has been cancelled Details
CI / Report status of build Prometheus for all architectures (push) Has been cancelled Details
CI / Publish main branch artifacts (push) Has been cancelled Details
CI / Publish release artefacts (push) Has been cancelled Details
CI / Publish UI on npm Registry (push) Has been cancelled Details

We check buckets in the similar test for histograms.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2025-07-31 14:03:20 +02:00
parent 6a7de712e1
commit f92da0977a
No known key found for this signature in database
GPG Key ID: 47A8F9CE80FD7C7F
1 changed files with 62 additions and 0 deletions

View File

@ -438,6 +438,68 @@ func TestPrometheusConverter_AddSummaryDataPoints(t *testing.T) {
}
},
},
{
name: "summary without start time and without scope promotion and some quantiles",
metric: func() pmetric.Metric {
metric := pmetric.NewMetric()
metric.SetName("test_summary")
metric.SetEmptySummary()
dp := metric.Summary().DataPoints().AppendEmpty()
dp.SetTimestamp(ts)
dp.SetCount(50)
dp.SetSum(100)
dp.QuantileValues().EnsureCapacity(2)
h := dp.QuantileValues().AppendEmpty()
h.SetQuantile(0.5)
h.SetValue(30)
n := dp.QuantileValues().AppendEmpty()
n.SetQuantile(0.9)
n.SetValue(40)
return metric
},
scope: defaultScope,
promoteScope: false,
want: func() []combinedSample {
return []combinedSample{
{
metricFamilyName: "test_summary",
ls: labels.FromStrings(
model.MetricNameLabel, "test_summary"+sumStr,
),
t: convertTimeStamp(ts),
v: 100,
},
{
metricFamilyName: "test_summary",
ls: labels.FromStrings(
model.MetricNameLabel, "test_summary"+countStr,
),
t: convertTimeStamp(ts),
v: 50,
},
{
metricFamilyName: "test_summary",
ls: labels.FromStrings(
model.MetricNameLabel, "test_summary",
quantileStr, "0.5",
),
t: convertTimeStamp(ts),
v: 30,
},
{
metricFamilyName: "test_summary",
ls: labels.FromStrings(
model.MetricNameLabel, "test_summary",
quantileStr, "0.9",
),
t: convertTimeStamp(ts),
v: 40,
},
}
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {