Esempio n. 1
0
 def to_runner_api_monitoring_info(self, name, transform_id):
     from apache_beam.metrics import monitoring_infos
     return monitoring_infos.int64_user_distribution(
         name.namespace,
         name.name,
         self.get_cumulative().to_runner_api_monitoring_info(),
         ptransform=transform_id)
Esempio n. 2
0
    def to_runner_api_monitoring_infos(self, transform_id):
        """Returns a list of MonitoringInfos for the metrics in this container."""
        all_user_metrics = []
        for k, v in self.counters.items():
            all_user_metrics.append(
                monitoring_infos.int64_user_counter(
                    k.namespace,
                    k.name,
                    v.to_runner_api_monitoring_info(),
                    ptransform=transform_id))

        for k, v in self.distributions.items():
            all_user_metrics.append(
                monitoring_infos.int64_user_distribution(
                    k.namespace,
                    k.name,
                    v.get_cumulative().to_runner_api_monitoring_info(),
                    ptransform=transform_id))

        for k, v in self.gauges.items():
            all_user_metrics.append(
                monitoring_infos.int64_user_gauge(
                    k.namespace,
                    k.name,
                    v.get_cumulative().to_runner_api_monitoring_info(),
                    ptransform=transform_id))
        return {monitoring_infos.to_key(mi): mi for mi in all_user_metrics}