MCPcopy Index your code
hub / github.com/prometheus/client_python / do_checks

Function do_checks

prometheus_client/openmetrics/parser.py:405–419  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

403 timestamp = None
404
405 def do_checks():
406 if bucket != float('+Inf'):
407 raise ValueError("+Inf bucket missing: " + name)
408 if count is not None and value != count:
409 raise ValueError("Count does not match +Inf value: " + name)
410 if has_sum and count is None:
411 raise ValueError("_count must be present if _sum is present: " + name)
412 if has_gsum and count is None:
413 raise ValueError("_gcount must be present if _gsum is present: " + name)
414 if not (has_sum or has_gsum) and count is not None:
415 raise ValueError("_sum/_gsum must be present if _count is present: " + name)
416 if has_negative_buckets and has_sum:
417 raise ValueError("Cannot have _sum with negative buckets: " + name)
418 if not has_negative_buckets and has_negative_gsum:
419 raise ValueError("Cannot have negative _gsum with non-negative buckets: " + name)
420
421 for s in samples:
422 suffix = s.name[len(name):]

Callers 1

_check_histogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected