Search in sources :

Example 51 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class LinkSerializer method writeWasToWasTargetRpcList.

private void writeWasToWasTargetRpcList(Link link, JsonGenerator jgen) throws IOException {
    // write additional information to be used for filtering failed WAS -> WAS call events.
    jgen.writeFieldName("filterTargetRpcList");
    jgen.writeStartArray();
    Collection<Application> sourceLinkTargetAgentList = link.getSourceLinkTargetAgentList();
    for (Application application : sourceLinkTargetAgentList) {
        jgen.writeStartObject();
        jgen.writeStringField("rpc", application.getName());
        jgen.writeNumberField("rpcServiceTypeCode", application.getServiceTypeCode());
        jgen.writeEndObject();
    }
    jgen.writeEndArray();
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application)

Example 52 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class LinkSerializer method serialize.

@Override
public void serialize(Link link, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
    jgen.writeStartObject();
    // for servermap
    jgen.writeStringField("key", link.getLinkName());
    // necessary for go.js
    jgen.writeStringField("from", link.getFrom().getNodeName());
    // necessary for go.js
    jgen.writeStringField("to", link.getTo().getNodeName());
    // for FilterWizard. from, to agent mapping data
    writeAgentId("fromAgent", link.getFrom(), jgen);
    writeAgentId("toAgent", link.getTo(), jgen);
    writeSimpleNode("sourceInfo", link.getFrom(), jgen);
    writeSimpleNode("targetInfo", link.getTo(), jgen);
    Application filterApplication = link.getFilterApplication();
    jgen.writeStringField("filterApplicationName", filterApplication.getName());
    jgen.writeNumberField("filterApplicationServiceTypeCode", filterApplication.getServiceTypeCode());
    jgen.writeStringField("filterApplicationServiceTypeName", filterApplication.getServiceType().getName());
    if (link.isWasToWasLink()) {
        writeWasToWasTargetRpcList(link, jgen);
    }
    Histogram histogram = link.getHistogram();
    // for go.js
    jgen.writeNumberField("totalCount", histogram.getTotalCount());
    jgen.writeNumberField("errorCount", histogram.getTotalErrorCount());
    jgen.writeNumberField("slowCount", histogram.getSlowCount());
    jgen.writeObjectField("histogram", histogram);
    // data showing how agents call each of their respective links
    writeAgentHistogram("sourceHistogram", link.getSourceList(), jgen);
    writeAgentHistogram("targetHistogram", link.getTargetList(), jgen);
    writeTimeSeriesHistogram(link, jgen);
    writeSourceAgentTimeSeriesHistogram(link, jgen);
    //        String state = link.getLinkState();
    //        jgen.writeStringField("state", state); // for go.js
    // for go.js
    jgen.writeBooleanField("hasAlert", link.getLinkAlert());
    jgen.writeEndObject();
}
Also used : Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) Application(com.navercorp.pinpoint.web.vo.Application)

Example 53 with Application

use of com.navercorp.pinpoint.web.vo.Application 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);
        }
    };
}
Also used : ApplicationIndexDao(com.navercorp.pinpoint.web.dao.ApplicationIndexDao) HashMap(java.util.HashMap) DataCollector(com.navercorp.pinpoint.web.alarm.collector.DataCollector) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) AlarmServiceImpl(com.navercorp.pinpoint.web.service.AlarmServiceImpl) List(java.util.List) LinkedList(java.util.LinkedList) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) BeforeClass(org.junit.BeforeClass)

Example 54 with Application

use of com.navercorp.pinpoint.web.vo.Application 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());
}
Also used : ErrorCountChecker(com.navercorp.pinpoint.web.alarm.checker.ErrorCountChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) Test(org.junit.Test)

Example 55 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class ErrorCountToCalleCheckerTest 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.ERROR_COUNT_TO_CALLEE.getName(), 6, "testGroup", false, false, TO_SERVICE_NAME + 1);
    ErrorCountToCalleeChecker checker = new ErrorCountToCalleeChecker(dataCollector, rule);
    checker.check();
    assertFalse(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector) ErrorCountToCalleeChecker(com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Aggregations

Application (com.navercorp.pinpoint.web.vo.Application)90 Test (org.junit.Test)39 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)30 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)11 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)10 Range (com.navercorp.pinpoint.web.vo.Range)10 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 List (java.util.List)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)4 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)4 ArrayList (java.util.ArrayList)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)3 ErrorCountToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker)3 ErrorRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker)3