Search in sources :

Example 1 with CustomMetricVo

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

the class GrpcCustomMetricMessageConverter method createLongCountMetric.

// raw data              : 10, 12, 13, 14, 14
// count metric format   : 10, 2, 1, 1, 0
private PCustomMetric createLongCountMetric(String metricName, CustomMetricVo[] customMetricVos) {
    PLongCountMetric.Builder longCountMetricBuilder = PLongCountMetric.newBuilder();
    longCountMetricBuilder.setName(metricName);
    long prevValue = 0;
    for (CustomMetricVo customMetricVo : customMetricVos) {
        if (customMetricVo instanceof LongCountMetricVo) {
            long value = ((LongCountMetricVo) customMetricVo).getValue();
            longCountMetricBuilder.addValues(createLongValue(value - prevValue));
            prevValue = value;
        } else {
            longCountMetricBuilder.addValues(createNotSetLongValue());
        }
    }
    PCustomMetric.Builder customMetricBuilder = PCustomMetric.newBuilder();
    customMetricBuilder.setLongCountMetric(longCountMetricBuilder.build());
    return customMetricBuilder.build();
}
Also used : PLongCountMetric(com.navercorp.pinpoint.grpc.trace.PLongCountMetric) CustomMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo) PCustomMetric(com.navercorp.pinpoint.grpc.trace.PCustomMetric) LongCountMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.LongCountMetricVo)

Example 2 with CustomMetricVo

use of com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo 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)

Example 3 with CustomMetricVo

use of com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo 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)

Example 4 with CustomMetricVo

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

the class GrpcCustomMetricMessageConverter method createIntCountMetric.

// raw data              : 10, 12, 13, 14, 14
// count metric format   : 10, 2, 1, 1, 0
private PCustomMetric createIntCountMetric(String metricName, CustomMetricVo[] customMetricVos) {
    PIntCountMetric.Builder intCountMetricBuilder = PIntCountMetric.newBuilder();
    intCountMetricBuilder.setName(metricName);
    int prevValue = 0;
    for (CustomMetricVo customMetricVo : customMetricVos) {
        if (customMetricVo instanceof IntCountMetricVo) {
            int value = ((IntCountMetricVo) customMetricVo).getValue();
            intCountMetricBuilder.addValues(createIntValue(value - prevValue));
            prevValue = value;
        } else {
            intCountMetricBuilder.addValues(createNotSetIntValue());
        }
    }
    PCustomMetric.Builder customMetricBuilder = PCustomMetric.newBuilder();
    customMetricBuilder.setIntCountMetric(intCountMetricBuilder.build());
    return customMetricBuilder.build();
}
Also used : PIntCountMetric(com.navercorp.pinpoint.grpc.trace.PIntCountMetric) IntCountMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.IntCountMetricVo) CustomMetricVo(com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo) PCustomMetric(com.navercorp.pinpoint.grpc.trace.PCustomMetric)

Example 5 with CustomMetricVo

use of com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo 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

CustomMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.CustomMetricVo)6 PCustomMetric (com.navercorp.pinpoint.grpc.trace.PCustomMetric)5 PDouleGaugeMetric (com.navercorp.pinpoint.grpc.trace.PDouleGaugeMetric)1 PIntCountMetric (com.navercorp.pinpoint.grpc.trace.PIntCountMetric)1 PIntGaugeMetric (com.navercorp.pinpoint.grpc.trace.PIntGaugeMetric)1 PLongCountMetric (com.navercorp.pinpoint.grpc.trace.PLongCountMetric)1 PLongGaugeMetric (com.navercorp.pinpoint.grpc.trace.PLongGaugeMetric)1 AgentCustomMetricSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.AgentCustomMetricSnapshot)1 DoubleGaugeMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.DoubleGaugeMetricVo)1 IntCountMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.IntCountMetricVo)1 IntGaugeMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.IntGaugeMetricVo)1 LongCountMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.LongCountMetricVo)1 LongGaugeMetricVo (com.navercorp.pinpoint.profiler.monitor.metric.custom.LongGaugeMetricVo)1