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);
}
}
}
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);
}
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;
}
Aggregations