use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector in project pinpoint by naver.
the class ErrorCountCheckerTest method checkTest1.
/*
* alert conditions not satisfied
*/
@Test
public void checkTest1() {
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.ERROR_COUNT.getName(), 74, "testGroup", false, false, "");
ErrorCountChecker filter = new ErrorCountChecker(collector, rule);
filter.check();
assertTrue(filter.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector in project pinpoint by naver.
the class ErrorRateCheckerTest 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.ERROR_RATE.getName(), 61, "testGroup", false, false, "");
ErrorRateChecker filter = new ErrorRateChecker(collector, rule);
filter.check();
assertFalse(filter.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector 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.alarm.collector.ResponseTimeDataCollector in project pinpoint by naver.
the class ReaderTest method beforeClass.
@BeforeClass
public static void beforeClass() {
applicationIndexDao = new ApplicationIndexDao() {
@Override
public List<Application> selectAllApplicationNames() {
List<Application> apps = new LinkedList<Application>();
for (int i = 0; i < 7; i++) {
apps.add(new Application(APP_NAME + i, ServiceType.STAND_ALONE));
}
return apps;
}
@Override
public List<String> selectAgentIds(String applicationName) {
return null;
}
@Override
public void deleteApplicationName(String applicationName) {
}
@Override
public void deleteAgentIds(Map<String, List<String>> applicationAgentIdMap) {
}
@Override
public void deleteAgentId(String applicationName, String agentId) {
}
};
alarmService = new AlarmServiceImpl() {
private Map<String, Rule> ruleMap;
{
ruleMap = new HashMap<String, Rule>();
for (int i = 0; i <= 6; i++) {
ruleMap.put(APP_NAME + i, new Rule(APP_NAME + i, SERVICE_TYPE, CheckerCategory.SLOW_COUNT.getName(), 76, "testGroup", false, false, ""));
}
}
@Override
public List<Rule> selectRuleByApplicationId(String applicationId) {
List<Rule> rules = new LinkedList<Rule>();
rules.add(ruleMap.get(applicationId));
return rules;
}
};
dataCollectorFactory = new DataCollectorFactory() {
@Override
public DataCollector createDataCollector(CheckerCategory checker, Application application, long timeSlotEndTime) {
return new ResponseTimeDataCollector(DataCollectorCategory.RESPONSE_TIME, null, null, 0, 0);
}
};
}
use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector in project pinpoint by naver.
the class ErrorCountCheckerTest 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.ERROR_COUNT.getName(), 76, "testGroup", false, false, "");
ErrorCountChecker filter = new ErrorCountChecker(collector, rule);
filter.check();
assertFalse(filter.isDetected());
}
Aggregations