schrodinger.seam.metric module¶
NOTE: The Metrics API is still actively being developed and is subject to change.
An API to access the user defined and Beam provided metrics of a Seam pipeline.
- class schrodinger.seam.metric.ExecutionMetrics(output_pcolls: Dict[str, int] = <factory>, user_labels: List[str] = <factory>, execution_times_seconds: Dict[str, float] = <factory>)¶
Bases:
object
- output_pcolls: Dict[str, int]¶
- execution_times_seconds: Dict[str, float]¶
- __init__(output_pcolls: typing.Dict[str, int] = <factory>, user_labels: typing.List[str] = <factory>, execution_times_seconds: typing.Dict[str, float] = <factory>) None ¶
- class schrodinger.seam.metric.SeamMetrics(*args, stage_metrics: Dict[str, schrodinger.seam.metric.ExecutionMetrics], **kwargs)¶
Bases:
apache_beam.metrics.metric.MetricResults
- __init__(*args, stage_metrics: Dict[str, schrodinger.seam.metric.ExecutionMetrics], **kwargs)¶
- query(filter: Optional[apache_beam.metrics.metric.MetricsFilter] = None) Dict[str, List[apache_beam.metrics.execution.MetricResult]] ¶
Queries the runner for existing user metrics that match the filter.
It should return a dictionary, with lists of each kind of metric, and each list contains the corresponding kind of MetricResult. Like so:
- {
“counters”: [MetricResult(counter_key, committed, attempted), …], “distributions”: [MetricResult(dist_key, committed, attempted), …], “gauges”: [] // Empty list if nothing matched the filter.
}
The committed / attempted values are DistributionResult / GaugeResult / int objects.
- save(file_path: Union[str, pathlib.Path])¶
Save a JSON dump of the metrics to a file.
- Parameters
file_path – The path to the file to save the metrics to.