mirror of
https://github.com/clearml/clearml-serving
synced 2025-01-31 02:46:54 +00:00
Fix metric scalar vector support
This commit is contained in:
parent
4355c1b1f4
commit
e0f18dc1f7
@ -37,14 +37,17 @@ class ScalarHistogram(Histogram):
|
||||
for details.
|
||||
"""
|
||||
self._raise_if_not_observable()
|
||||
self._sum.inc(1)
|
||||
for i, bound in enumerate(self._upper_bounds):
|
||||
if amount <= bound:
|
||||
self._buckets[i].inc(1)
|
||||
if exemplar:
|
||||
_validate_exemplar(exemplar)
|
||||
self._buckets[i].set_exemplar(Exemplar(exemplar, amount, time()))
|
||||
break
|
||||
if not isinstance(amount, (list, tuple)):
|
||||
amount = [amount]
|
||||
self._sum.inc(len(amount))
|
||||
for v in amount:
|
||||
for i, bound in enumerate(self._upper_bounds):
|
||||
if v <= bound:
|
||||
self._buckets[i].inc(1)
|
||||
if exemplar:
|
||||
_validate_exemplar(exemplar)
|
||||
self._buckets[i].set_exemplar(Exemplar(exemplar, v, time()))
|
||||
break
|
||||
|
||||
def _child_samples(self) -> Iterable[Sample]:
|
||||
samples = []
|
||||
|
Loading…
Reference in New Issue
Block a user