use of org.apache.beam.runners.core.metrics.GaugeData in project beam by apache.
the class PortableMetrics method convertGaugeMonitoringInfoToGauge.
private static MetricResult<GaugeResult> convertGaugeMonitoringInfoToGauge(MetricsApi.MonitoringInfo monitoringInfo) {
Map<String, String> labelsMap = monitoringInfo.getLabelsMap();
MetricKey key = MetricKey.create(labelsMap.get(STEP_NAME_LABEL), MetricName.named(labelsMap.get(NAMESPACE_LABEL), labelsMap.get(METRIC_NAME_LABEL)));
GaugeData data = decodeInt64Gauge(monitoringInfo.getPayload());
GaugeResult result = GaugeResult.create(data.value(), data.timestamp());
return MetricResult.create(key, false, result);
}
Aggregations