Search in sources :

Example 21 with HistogramSchema

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

the class HistogramSchemaTest method testFindHistogramSlot.

@Test
public void testFindHistogramSlot() throws Exception {
    HistogramSchema histogramSchema = ServiceType.STAND_ALONE.getHistogramSchema();
    Assert.assertEquals(histogramSchema.findHistogramSlot(999, false).getSlotTime(), 1000);
    Assert.assertEquals(histogramSchema.findHistogramSlot(1000, false).getSlotTime(), 1000);
    Assert.assertEquals(histogramSchema.findHistogramSlot(1111, false).getSlotTime(), 3000);
}
Also used : HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) Test(org.junit.Test)

Example 22 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 : BaseHistogramSchema(com.navercorp.pinpoint.common.trace.BaseHistogramSchema) HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) Test(org.junit.Test)

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