apache_beam.metrics.metricbase module
The classes in this file are interfaces for metrics. They are not intended to be subclassed or created directly by users. To work with and access metrics, users should use the classes and methods exposed in metric.py.
Available classes:
Metric - Base interface of a metrics object.
- Counter - Counter metric interface. Allows a count to be incremented or
decremented during pipeline execution.
- Distribution - Distribution Metric interface. Allows statistics about the
distribution of a variable to be collected during pipeline execution.
- Gauge - Gauge Metric interface. Allows to track the latest value of a
variable during pipeline execution.
MetricName - Namespace and name used to refer to a Metric.
- class apache_beam.metrics.metricbase.Metric(metric_name: MetricName)[source]
Bases:
object
Base interface of a metric object.
- class apache_beam.metrics.metricbase.Counter(metric_name: MetricName)[source]
Bases:
Metric
Counter metric interface. Allows a count to be incremented/decremented during pipeline execution.
- class apache_beam.metrics.metricbase.Distribution(metric_name: MetricName)[source]
Bases:
Metric
Distribution Metric interface.
Allows statistics about the distribution of a variable to be collected during pipeline execution.
- class apache_beam.metrics.metricbase.Gauge(metric_name: MetricName)[source]
Bases:
Metric
Gauge Metric interface.
Allows tracking of the latest value of a variable during pipeline execution.
- class apache_beam.metrics.metricbase.StringSet(metric_name: MetricName)[source]
Bases:
Metric
StringSet Metric interface.
Reports set of unique string values during pipeline execution..
- class apache_beam.metrics.metricbase.Histogram(metric_name: MetricName)[source]
Bases:
Metric
Histogram Metric interface.
Allows statistics about the percentile of a variable to be collected during pipeline execution.
- class apache_beam.metrics.metricbase.MetricName(namespace: str | None, name: str | None, urn: str | None = None, labels: Dict[str, str] | None = None)[source]
Bases:
object
The name of a metric.
The name of a metric consists of a namespace and a name. The namespace allows grouping related metrics together and also prevents collisions between multiple metrics of the same name.
Initializes
MetricName
.Note: namespace and name should be set for user metrics, urn and labels should be set for an arbitrary metric to package into a MonitoringInfo.
- Parameters:
namespace – A string with the namespace of a metric.
name – A string with the name of a metric.
urn – URN to populate on a MonitoringInfo, when sending to RunnerHarness.
labels – Labels to populate on a MonitoringInfo