Search in sources :

Example 1 with LongGaugeMetricVo

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

the class GrpcCustomMetricMessageConverter method createLongGaugeMetric.

private PCustomMetric createLongGaugeMetric(String metricName, CustomMetricVo[] customMetricVos) {
    PLongGaugeMetric.Builder longGaugeMetricBuilder = PLongGaugeMetric.newBuilder();
    longGaugeMetricBuilder.setName(metricName);
    for (CustomMetricVo customMetricVo : customMetricVos) {
        if (customMetricVo instanceof LongGaugeMetricVo) {
            long value = ((LongGaugeMetricVo) customMetricVo).getValue();
            longGaugeMetricBuilder.addValues(createLongValue(value));
        } else {
            longGaugeMetricBuilder.addValues(createNotSetLongValue());
        }
    }
    PCustomMetric.Builder customMetricBuilder = PCustomMetric.newBuilder();
    customMetricBuilder.setLongGaugeMetric(longGaugeMetricBuilder.build());
    return customMetricBuilder.build();
}
Also used : LongGaugeMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.LongGaugeMetricVo) PLongGaugeMetric(com.navercorp.pinpoint.grpc.trace.PLongGaugeMetric) CustomMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo) PCustomMetric(com.navercorp.pinpoint.grpc.trace.PCustomMetric)

Aggregations

PCustomMetric (com.navercorp.pinpoint.grpc.trace.PCustomMetric)1 PLongGaugeMetric (com.navercorp.pinpoint.grpc.trace.PLongGaugeMetric)1 CustomMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo)1 LongGaugeMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.LongGaugeMetricVo)1