Source code for thriftworker.utils.stats.timers

from __future__ import absolute_import

from collections import defaultdict

from .timer import Timer


[docs]class Timers(defaultdict): def __init__(self): super(Timers, self).__init__(Timer)
[docs] def to_dict(self): """Convert all timers to dict.""" return {key: {'mean': timer.mean, 'stddev': timer.stddev, 'sum': timer.sum, 'count': timer.count, 'squared_sum': timer.squared_sum, 'min': timer.min, 'max': timer.max, 'distribution95': timer.query(0.95)} for key, timer in self.items()}
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.