Search in sources :

Example 16 with HistogramSchema

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

the class HistogramTest method testJson.

@Test
public void testJson() throws Exception {
    HistogramSchema schema = ServiceType.STAND_ALONE.getHistogramSchema();
    Histogram original = new Histogram(ServiceType.STAND_ALONE);
    original.addCallCount(schema.getFastSlot().getSlotTime(), 100);
    String json = objectMapper.writeValueAsString(original);
    HashMap hashMap = objectMapper.readValue(json, HashMap.class);
    Assert.assertEquals(hashMap.get(schema.getFastSlot().getSlotName()), 100);
    Assert.assertEquals(hashMap.get(schema.getErrorSlot().getSlotName()), 0);
}
Also used : HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 17 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 18 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)

Example 19 with HistogramSchema

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

the class HistogramTest method testAddResponseTime.

@Test
public void testAddResponseTime() {
    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 20 with HistogramSchema

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

the class HbaseMapStatisticsCalleeDao method update.

@Override
public void update(String calleeApplicationName, ServiceType calleeServiceType, String callerApplicationName, ServiceType callerServiceType, String callerHost, int elapsed, boolean isError) {
    Objects.requireNonNull(calleeApplicationName, "calleeApplicationName");
    Objects.requireNonNull(callerApplicationName, "callerApplicationName");
    if (logger.isDebugEnabled()) {
        logger.debug("[Callee] {} ({}) <- {} ({})[{}]", calleeApplicationName, calleeServiceType, callerApplicationName, callerServiceType, callerHost);
    }
    // there may be no endpoint in case of httpclient
    callerHost = StringUtils.defaultString(callerHost);
    // TODO callee, caller parameter normalization
    if (ignoreStatFilter.filter(calleeServiceType, callerHost)) {
        logger.debug("[Ignore-Callee] {} ({}) <- {} ({})[{}]", calleeApplicationName, calleeServiceType, callerApplicationName, callerServiceType, callerHost);
        return;
    }
    // make row key. rowkey is me
    final long acceptedTime = acceptedTimeService.getAcceptedTime();
    final long rowTimeSlot = timeSlot.getTimeSlot(acceptedTime);
    final RowKey calleeRowKey = new CallRowKey(calleeApplicationName, calleeServiceType.getCode(), rowTimeSlot);
    final short callerSlotNumber = ApplicationMapStatisticsUtils.getSlotNumber(calleeServiceType, elapsed, isError);
    HistogramSchema histogramSchema = calleeServiceType.getHistogramSchema();
    final ColumnName callerColumnName = new CallerColumnName(callerServiceType.getCode(), callerApplicationName, callerHost, callerSlotNumber);
    this.bulkWriter.increment(calleeRowKey, callerColumnName);
    if (mapLinkConfiguration.isEnableAvg()) {
        final ColumnName sumColumnName = new CallerColumnName(callerServiceType.getCode(), callerApplicationName, callerHost, histogramSchema.getSumStatSlot().getSlotTime());
        this.bulkWriter.increment(calleeRowKey, sumColumnName, elapsed);
    }
    if (mapLinkConfiguration.isEnableMax()) {
        final ColumnName maxColumnName = new CallerColumnName(callerServiceType.getCode(), callerApplicationName, callerHost, histogramSchema.getMaxStatSlot().getSlotTime());
        this.bulkWriter.updateMax(calleeRowKey, maxColumnName, elapsed);
    }
}
Also used : ColumnName(com.navercorp.pinpoint.collector.dao.hbase.statistics.ColumnName) CallerColumnName(com.navercorp.pinpoint.collector.dao.hbase.statistics.CallerColumnName) HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) CallRowKey(com.navercorp.pinpoint.collector.dao.hbase.statistics.CallRowKey) CallRowKey(com.navercorp.pinpoint.collector.dao.hbase.statistics.CallRowKey) RowKey(com.navercorp.pinpoint.collector.dao.hbase.statistics.RowKey) CallerColumnName(com.navercorp.pinpoint.collector.dao.hbase.statistics.CallerColumnName)

Aggregations

HistogramSchema (com.navercorp.pinpoint.common.trace.HistogramSchema)22 Test (org.junit.Test)8 HistogramSlot (com.navercorp.pinpoint.common.trace.HistogramSlot)4 CallRowKey (com.navercorp.pinpoint.collector.dao.hbase.statistics.CallRowKey)3 ColumnName (com.navercorp.pinpoint.collector.dao.hbase.statistics.ColumnName)3 RowKey (com.navercorp.pinpoint.collector.dao.hbase.statistics.RowKey)3 Histogram (com.navercorp.pinpoint.web.applicationmap.histogram.Histogram)3 ResponseTimeViewModel (com.navercorp.pinpoint.web.view.ResponseTimeViewModel)3 SpanBo (com.navercorp.pinpoint.common.server.bo.SpanBo)2 BaseHistogramSchema (com.navercorp.pinpoint.common.trace.BaseHistogramSchema)2 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)2 HistogramSnapshot (com.navercorp.pinpoint.profiler.monitor.metric.rpc.HistogramSnapshot)2 AgentResponseTimeViewModel (com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel)2 Application (com.navercorp.pinpoint.web.vo.Application)2 CalleeColumnName (com.navercorp.pinpoint.collector.dao.hbase.statistics.CalleeColumnName)1 CallerColumnName (com.navercorp.pinpoint.collector.dao.hbase.statistics.CallerColumnName)1 ResponseColumnName (com.navercorp.pinpoint.collector.dao.hbase.statistics.ResponseColumnName)1 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)1 ActiveTraceHistogram (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram)1 SlotType (com.navercorp.pinpoint.common.trace.SlotType)1