use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class AgentHistogramTest method testJsonCompatibility.
@Test
public void testJsonCompatibility() throws Exception {
// compatibility test for changing to Jackson
AgentHistogram agentHistogram = new AgentHistogram(new Application("test", ServiceType.STAND_ALONE));
TimeHistogram histogram = new TimeHistogram(ServiceType.STAND_ALONE, 0);
histogram.addCallCount(ServiceType.STAND_ALONE.getHistogramSchema().getFastErrorSlot().getSlotTime(), 1);
agentHistogram.addTimeHistogram(histogram);
AgentHistogram copy = new AgentHistogram(agentHistogram);
logger.debug(copy.getHistogram().toString());
Assert.assertEquals(copy.getHistogram().getTotalErrorCount(), 1);
TimeHistogram histogram2 = new TimeHistogram(ServiceType.STAND_ALONE, 0);
histogram2.addCallCount(ServiceType.STAND_ALONE.getHistogramSchema().getFastErrorSlot().getSlotTime(), 2);
agentHistogram.addTimeHistogram(histogram2);
Assert.assertEquals(agentHistogram.getHistogram().getTotalErrorCount(), 3);
String callJson = mapper.writeValueAsString(agentHistogram);
String before = originalJson(agentHistogram);
logger.debug("callJson:{}", callJson);
HashMap callJsonHashMap = mapper.readValue(callJson, HashMap.class);
logger.debug("BEFORE:{}", before);
HashMap beforeJsonHashMap = mapper.readValue(before, HashMap.class);
logger.debug("{} {}", callJsonHashMap, beforeJsonHashMap);
Assert.assertEquals(callJsonHashMap, beforeJsonHashMap);
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class JvmCpuUsageRateCheckerTest method checkTest2.
@Test
public void checkTest2() {
Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.JVM_CPU_USAGE_RATE.getName(), 61, "testGroup", false, false, "");
Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
AgentChecker checker = new JvmCpuUsageRateChecker(collector, rule);
checker.check();
assertFalse(checker.isDetected());
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class SlowCountCheckerTest method checkTest2.
/*
* alert conditions not satisfied
*/
@Test
public void checkTest2() {
Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
ResponseTimeDataCollector collector = new ResponseTimeDataCollector(DataCollectorCategory.RESPONSE_TIME, application, mockMapResponseDAO, System.currentTimeMillis(), 300000);
Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.SLOW_COUNT.getName(), 76, "testGroup", false, false, "");
SlowCountChecker checker = new SlowCountChecker(collector, rule);
checker.check();
assertFalse(checker.isDetected());
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class SlowCountToCalleCheckerTest method checkTest2.
@Test
public void checkTest2() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.SLOW_COUNT_TO_CALLEE.getName(), 8, "testGroup", false, false, TO_SERVICE_NAME + 1);
SlowCountToCalleeChecker checker = new SlowCountToCalleeChecker(dataCollector, rule);
checker.check();
assertFalse(checker.isDetected());
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class SlowRateToCalleCheckerTest method checkTest2.
@Test
public void checkTest2() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.SLOW_RATE_TO_CALLEE.getName(), 71, "testGroup", false, false, TO_SERVICE_NAME + 1);
SlowRateToCalleeChecker checker = new SlowRateToCalleeChecker(dataCollector, rule);
checker.check();
assertFalse(checker.isDetected());
}
Aggregations