Exemplo n.º 1
0
 def __init__(self, metric_name, bucket_type, logger):
   # type: (MetricName, BucketType, Optional[MetricLogger]) -> None
   super(Metrics.DelegatingHistogram, self).__init__(metric_name)
   self.metric_name = metric_name
   self.cell_type = HistogramCellFactory(bucket_type)
   self.logger = logger
   self.updater = MetricUpdater(self.cell_type, self.metric_name)
Exemplo n.º 2
0
 def __init__(self, metric_name, process_wide=False):
     # type: (MetricName, bool) -> None
     super().__init__(metric_name)
     self.inc = MetricUpdater(  # type: ignore[assignment]
         cells.CounterCell,
         metric_name,
         default_value=1,
         process_wide=process_wide)
Exemplo n.º 3
0
 def __init__(self, metric_name):
     # type: (MetricName) -> None
     super(Metrics.DelegatingGauge, self).__init__(metric_name)
     self.set = MetricUpdater(cells.GaugeCell,
                              metric_name)  # type: ignore[assignment]
Exemplo n.º 4
0
 def __init__(self, metric_name):
     # type: (MetricName) -> None
     super(Metrics.DelegatingDistribution, self).__init__(metric_name)
     self.update = MetricUpdater(
         cells.DistributionCell,
         metric_name)  # type: ignore[assignment]
Exemplo n.º 5
0
 def __init__(self, metric_name):
     # type: (MetricName) -> None
     super(Metrics.DelegatingCounter, self).__init__(metric_name)
     self.inc = MetricUpdater(cells.CounterCell, metric_name,
                              default=1)  # type: ignore[assignment]
Exemplo n.º 6
0
 def __init__(self, metric_name):
   super(Metrics.DelegatingGauge, self).__init__()
   self.metric_name = metric_name
   self.set = MetricUpdater(cells.GaugeCell, metric_name)
Exemplo n.º 7
0
 def __init__(self, metric_name):
   super(Metrics.DelegatingDistribution, self).__init__()
   self.metric_name = metric_name
   self.update = MetricUpdater(cells.DistributionCell, metric_name)
Exemplo n.º 8
0
 def __init__(self, metric_name):
   super(Metrics.DelegatingCounter, self).__init__()
   self.metric_name = metric_name
   self.inc = MetricUpdater(cells.CounterCell, metric_name, default=1)