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