Skip to content

Commit e405af1

Browse files
committed
Update tests
1 parent ef797b3 commit e405af1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

qa/python_models/custom_metrics/model.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ def test_gauge_e2e(self):
218218
description="test metric gauge kind end to end",
219219
kind=pb_utils.MetricFamily.GAUGE,
220220
)
221-
labels = {"example1": "counter_label1", "example2": "counter_label2"}
221+
labels = {"example1": "gauge_label1", "example2": "gauge_label2"}
222222
metric = metric_family.Metric(labels=labels)
223223
self._metric_api_helper(metric, "gauge")
224224

225-
pattern = 'test_gauge_e2e{example1="counter_label1",example2="counter_label2"}'
225+
pattern = 'test_gauge_e2e{example1="gauge_label1",example2="gauge_label2"}'
226226
metrics = self._get_metrics()
227227
self.assertIn(pattern, metrics)
228228

@@ -233,10 +233,17 @@ def test_histogram_e2e(self):
233233
description="test metric histogram kind end to end",
234234
kind=pb_utils.MetricFamily.HISTOGRAM,
235235
)
236-
labels = {"example1": "counter_label1", "example2": "counter_label2"}
236+
labels = {"example1": "histogram_label1", "example2": "histogram_label2"}
237+
238+
# Test non-ascending order buckets
239+
with self.assertRaises(pb_utils.TritonModelException):
240+
metric = metric_family.Metric(
241+
labels=labels, buckets=[2.5, 0.1, 1.0, 10.0, 5.0]
242+
)
243+
237244
buckets = [0.1, 1.0, 2.5, 5.0, 10.0]
238245
metric = metric_family.Metric(labels=labels, buckets=buckets)
239-
labels_str = 'example1="counter_label1",example2="counter_label2"'
246+
labels_str = 'example1="histogram_label1",example2="histogram_label2"'
240247
self._histogram_api_helper(metric, name, labels_str)
241248

242249
metrics = self._get_metrics()

0 commit comments

Comments
 (0)