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

Method _child_samples

prometheus_client/metrics.py:692–703  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

690 return Timer(self, 'observe')
691
692 def _child_samples(self) -> Iterable[Sample]:
693 samples = []
694 acc = 0.0
695 for i, bound in enumerate(self._upper_bounds):
696 acc += self._buckets[i].get()
697 samples.append(Sample('_bucket', {'le': floatToGoString(bound)}, acc, None, self._buckets[i].get_exemplar()))
698 samples.append(Sample('_count', {}, acc, None, None))
699 if self._upper_bounds[0] >= 0:
700 samples.append(Sample('_sum', {}, self._sum.get(), None, None))
701 if _use_created:
702 samples.append(Sample('_created', {}, self._created, None, None))
703 return tuple(samples)
704
705
706class Info(MetricWrapperBase):

Callers

nothing calls this directly

Calls 4

SampleClass · 0.85
floatToGoStringFunction · 0.85
getMethod · 0.45
get_exemplarMethod · 0.45

Tested by

no test coverage detected