Search in sources :

Example 1 with GaugeData

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);
}
Also used : MetricKey(org.apache.beam.sdk.metrics.MetricKey) GaugeData(org.apache.beam.runners.core.metrics.GaugeData) GaugeResult(org.apache.beam.sdk.metrics.GaugeResult)

Aggregations

GaugeData (org.apache.beam.runners.core.metrics.GaugeData)1 GaugeResult (org.apache.beam.sdk.metrics.GaugeResult)1 MetricKey (org.apache.beam.sdk.metrics.MetricKey)1