Search in sources :

Example 1 with IntGaugeMetricVo

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

the class GrpcCustomMetricMessageConverter method createIntGaugeMetric.

private PCustomMetric createIntGaugeMetric(String metricName, CustomMetricVo[] customMetricVos) {
    PIntGaugeMetric.Builder intGaugeMetricBuilder = PIntGaugeMetric.newBuilder();
    intGaugeMetricBuilder.setName(metricName);
    for (CustomMetricVo customMetricVo : customMetricVos) {
        if (customMetricVo instanceof IntGaugeMetricVo) {
            int value = ((IntGaugeMetricVo) customMetricVo).getValue();
            intGaugeMetricBuilder.addValues(createIntValue(value));
        } else {
            intGaugeMetricBuilder.addValues(createNotSetIntValue());
        }
    }
    PCustomMetric.Builder customMetricBuilder = PCustomMetric.newBuilder();
    customMetricBuilder.setIntGaugeMetric(intGaugeMetricBuilder.build());
    return customMetricBuilder.build();
}
Also used : IntGaugeMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.IntGaugeMetricVo) PIntGaugeMetric(com.navercorp.pinpoint.grpc.trace.PIntGaugeMetric) 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 PIntGaugeMetric (com.navercorp.pinpoint.grpc.trace.PIntGaugeMetric)1 CustomMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo)1 IntGaugeMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.IntGaugeMetricVo)1