Search in sources :

Example 11 with HistogramSchema

use of com.navercorp.pinpoint.common.trace.HistogramSchema in project pinpoint by naver.

the class LegacyAgentStatChartGroup method addActiveTraceData.

private void addActiveTraceData(AgentStat agentStat) {
    long timestamp = agentStat.getTimestamp();
    HistogramSchema schema = agentStat.getHistogramSchema();
    if (schema != null) {
        Map<SlotType, Integer> activeTraceCounts = agentStat.getActiveTraceCounts();
        int fastCount = activeTraceCounts.get(SlotType.FAST);
        if (fastCount != UNCOLLECTED_DATA) {
            TitledDataPoint<Long, Integer> fastDataPoint = new TitledDataPoint<>(schema.getFastSlot().getSlotName(), timestamp, fastCount);
            this.activeTraceFastChartBuilder.addDataPoint(fastDataPoint);
        }
        int normalCount = activeTraceCounts.get(SlotType.NORMAL);
        if (normalCount != UNCOLLECTED_DATA) {
            TitledDataPoint<Long, Integer> normalDataPoint = new TitledDataPoint<>(schema.getNormalSlot().getSlotName(), timestamp, normalCount);
            this.activeTraceNormalChartBuilder.addDataPoint(normalDataPoint);
        }
        int slowCount = activeTraceCounts.get(SlotType.SLOW);
        if (slowCount != UNCOLLECTED_DATA) {
            TitledDataPoint<Long, Integer> slowDataPoint = new TitledDataPoint<>(schema.getSlowSlot().getSlotName(), timestamp, slowCount);
            this.activeTraceSlowChartBuilder.addDataPoint(slowDataPoint);
        }
        int verySlowCount = activeTraceCounts.get(SlotType.VERY_SLOW);
        if (verySlowCount != UNCOLLECTED_DATA) {
            TitledDataPoint<Long, Integer> verySlowDataPoint = new TitledDataPoint<>(schema.getVerySlowSlot().getSlotName(), timestamp, verySlowCount);
            this.activeTraceVerySlowChartBuilder.addDataPoint(verySlowDataPoint);
        }
    }
}
Also used : HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) TitledDataPoint(com.navercorp.pinpoint.web.vo.chart.TitledDataPoint) DataPoint(com.navercorp.pinpoint.web.vo.chart.DataPoint) SlotType(com.navercorp.pinpoint.common.trace.SlotType) TitledDataPoint(com.navercorp.pinpoint.web.vo.chart.TitledDataPoint)

Example 12 with HistogramSchema

use of com.navercorp.pinpoint.common.trace.HistogramSchema in project pinpoint by naver.

the class HistogramTest method testAddResponseTime.

@Test
public void testAddResponseTime() throws Exception {
    HistogramSchema schema = ServiceType.STAND_ALONE.getHistogramSchema();
    LongAdderHistogram histogram = new LongAdderHistogram(ServiceType.STAND_ALONE);
    histogram.addResponseTime(1000, false);
    histogram.addResponseTime(3000, false);
    histogram.addResponseTime(3000, false);
    histogram.addResponseTime(5000, false);
    histogram.addResponseTime(5000, false);
    histogram.addResponseTime(5000, false);
    histogram.addResponseTime(6000, false);
    histogram.addResponseTime(6000, false);
    histogram.addResponseTime(6000, false);
    histogram.addResponseTime(6000, false);
    histogram.addResponseTime(schema.getFastSlot().getSlotTime(), true);
    histogram.addResponseTime(schema.getFastSlot().getSlotTime(), true);
    histogram.addResponseTime(schema.getFastSlot().getSlotTime(), true);
    histogram.addResponseTime(schema.getFastSlot().getSlotTime(), true);
    histogram.addResponseTime(schema.getFastSlot().getSlotTime(), true);
    HistogramSnapshot snapshot = histogram.createSnapshot();
    Assert.assertEquals(snapshot.getFastCount(), 1);
    Assert.assertEquals(snapshot.getNormalCount(), 2);
    Assert.assertEquals(snapshot.getSlowCount(), 3);
    Assert.assertEquals(snapshot.getVerySlowCount(), 4);
    Assert.assertEquals(snapshot.getFastErrorCount(), 5);
}
Also used : LongAdderHistogram(com.navercorp.pinpoint.profiler.monitor.metric.rpc.LongAdderHistogram) HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) HistogramSnapshot(com.navercorp.pinpoint.profiler.monitor.metric.rpc.HistogramSnapshot) Test(org.junit.Test)

Example 13 with HistogramSchema

use of com.navercorp.pinpoint.common.trace.HistogramSchema in project pinpoint by naver.

the class AgentTimeHistogram method createResponseTimeViewModel.

public List<ResponseTimeViewModel> createResponseTimeViewModel(List<TimeHistogram> timeHistogramList) {
    final List<ResponseTimeViewModel> value = new ArrayList<>(5);
    ServiceType serviceType = application.getServiceType();
    HistogramSchema schema = serviceType.getHistogramSchema();
    value.add(new ResponseTimeViewModel(schema.getFastSlot().getSlotName(), getColumnValue(SlotType.FAST, timeHistogramList)));
    //        value.add(new ResponseTimeViewModel(schema.getFastErrorSlot().getSlotName(), getColumnValue(SlotType.FAST_ERROR, timeHistogramList)));
    value.add(new ResponseTimeViewModel(schema.getNormalSlot().getSlotName(), getColumnValue(SlotType.NORMAL, timeHistogramList)));
    //        value.add(new ResponseTimeViewModel(schema.getNormalErrorSlot().getSlotName(), getColumnValue(SlotType.NORMAL_ERROR, timeHistogramList)));
    value.add(new ResponseTimeViewModel(schema.getSlowSlot().getSlotName(), getColumnValue(SlotType.SLOW, timeHistogramList)));
    //        value.add(new ResponseTimeViewModel(schema.getSlowErrorSlot().getSlotName(), getColumnValue(SlotType.SLOW_ERROR, timeHistogramList)));
    value.add(new ResponseTimeViewModel(schema.getVerySlowSlot().getSlotName(), getColumnValue(SlotType.VERY_SLOW, timeHistogramList)));
    //        value.add(new ResponseTimeViewModel(schema.getVerySlowErrorSlot().getSlotName(), getColumnValue(SlotType.VERY_SLOW_ERROR, timeHistogramList)));
    value.add(new ResponseTimeViewModel(schema.getErrorSlot().getSlotName(), getColumnValue(SlotType.ERROR, timeHistogramList)));
    return value;
}
Also used : HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) AgentResponseTimeViewModel(com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel) ResponseTimeViewModel(com.navercorp.pinpoint.web.view.ResponseTimeViewModel)

Aggregations

HistogramSchema (com.navercorp.pinpoint.common.trace.HistogramSchema)13 Test (org.junit.Test)5 HistogramSlot (com.navercorp.pinpoint.common.trace.HistogramSlot)2 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)2 SlotType (com.navercorp.pinpoint.common.trace.SlotType)2 HistogramSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.rpc.HistogramSnapshot)2 Histogram (com.navercorp.pinpoint.web.applicationmap.histogram.Histogram)2 ResponseTimeViewModel (com.navercorp.pinpoint.web.view.ResponseTimeViewModel)2 HashMap (java.util.HashMap)2 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)1 BaseHistogramSchema (com.navercorp.pinpoint.common.trace.BaseHistogramSchema)1 DefaultRpcMetric (com.navercorp.pinpoint.profiler.monitor.metric.rpc.DefaultRpcMetric)1 LongAdderHistogram (com.navercorp.pinpoint.profiler.monitor.metric.rpc.LongAdderHistogram)1 AgentResponseTimeViewModel (com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel)1 DataPoint (com.navercorp.pinpoint.web.vo.chart.DataPoint)1 TitledDataPoint (com.navercorp.pinpoint.web.vo.chart.TitledDataPoint)1 SampledActiveTrace (com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace)1 ArrayList (java.util.ArrayList)1