def get(self,
labels: LabelsType) -> Dict[Union[float, str], NumericValueType]:
'''
Get gets a dict of values, containing the sum, count and percentiles,
matching an arbitrary group of labels.
:raises: KeyError if an item with matching labels is not present.
'''
return_data = {} # type: Dict[Union[float, str], NumericValueType]
e = self.get_value(labels)
e = cast(Any, e) # typing check, no runtime behaviour.
# Set invariants data (default to 0.50, 0.90 and 0.99)
for i in e._invariants: # type: ignore
q = i._quantile
return_data[q] = e.query(q) # type: ignore
# Set sum and count
return_data[self.SUM_KEY] = e._sum # type: ignore
return_data[self.COUNT_KEY] = e._observations # type: ignore
return return_data
评论列表
文章目录