Ejemplo n.º 1
0
 def __init__(self, name, fields=(), docstring=None, units=None):
   """Initializes a Counter metric and registers it with the StatsCollector."""
   super().__init__(
       rdf_stats.MetricMetadata(
           varname=name,
           metric_type=rdf_stats.MetricMetadata.MetricType.COUNTER,
           value_type=rdf_stats.MetricMetadata.ValueType.INT,
           fields_defs=stats_utils.FieldDefinitionProtosFromTuples(fields),
           docstring=docstring,
           units=units))
Ejemplo n.º 2
0
 def __init__(self, name, value_type, fields=(), docstring=None, units=None):
   """Initializes a Gauge metric and registers it with the StatsCollector."""
   super().__init__(
       rdf_stats.MetricMetadata(
           varname=name,
           metric_type=rdf_stats.MetricMetadata.MetricType.GAUGE,
           value_type=stats_utils.MetricValueTypeFromPythonType(value_type),
           fields_defs=stats_utils.FieldDefinitionProtosFromTuples(fields),
           docstring=docstring,
           units=units))
Ejemplo n.º 3
0
 def __init__(self, name, bins=(), fields=(), docstring=None, units=None):
   """Initializes an Event metric and registers it with the StatsCollector."""
   super().__init__(
       rdf_stats.MetricMetadata(
           varname=name,
           bins=bins,
           metric_type=rdf_stats.MetricMetadata.MetricType.EVENT,
           value_type=rdf_stats.MetricMetadata.ValueType.DISTRIBUTION,
           fields_defs=stats_utils.FieldDefinitionProtosFromTuples(fields),
           docstring=docstring,
           units=units))