Search in sources :

Example 1 with DoubleGaugeMetricVo

use of com.navercorp.pinpoint.profiler.monitor.metric.custom.DoubleGaugeMetricVo in project pinpoint by naver.

the class GrpcCustomMetricMessageConverter method createDoubleGaugeMetric.

private PCustomMetric createDoubleGaugeMetric(String metricName, CustomMetricVo[] customMetricVos) {
    PDouleGaugeMetric.Builder doubleGaugeMetricBuilder = PDouleGaugeMetric.newBuilder();
    doubleGaugeMetricBuilder.setName(metricName);
    for (CustomMetricVo customMetricVo : customMetricVos) {
        if (customMetricVo instanceof DoubleGaugeMetricVo) {
            double value = ((DoubleGaugeMetricVo) customMetricVo).getValue();
            doubleGaugeMetricBuilder.addValues(createDoubleValue(value));
        } else {
            doubleGaugeMetricBuilder.addValues(createNotSetDoubleValue());
        }
    }
    PCustomMetric.Builder customMetricBuilder = PCustomMetric.newBuilder();
    customMetricBuilder.setDoubleGaugeMetric(doubleGaugeMetricBuilder.build());
    return customMetricBuilder.build();
}
Also used : PDouleGaugeMetric(com.navercorp.pinpoint.grpc.trace.PDouleGaugeMetric) CustomMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo) PCustomMetric(com.navercorp.pinpoint.grpc.trace.PCustomMetric) DoubleGaugeMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.DoubleGaugeMetricVo)

Aggregations

PCustomMetric (com.navercorp.pinpoint.grpc.trace.PCustomMetric)1 PDouleGaugeMetric (com.navercorp.pinpoint.grpc.trace.PDouleGaugeMetric)1 CustomMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo)1 DoubleGaugeMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.DoubleGaugeMetricVo)1