Search in sources :

Example 6 with Application

use of org.apache.skywalking.apm.collector.storage.table.register.Application in project incubator-skywalking by apache.

the class TopologyBuilder method calleeReferenceMetricFilter.

private List<IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric> calleeReferenceMetricFilter(List<IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric> calleeReferenceMetric) {
    List<IApplicationReferenceMetricUIDAO.ApplicationReferenceMetric> filteredMetrics = new LinkedList<>();
    calleeReferenceMetric.forEach(referenceMetric -> {
        Application source = applicationCacheService.getApplicationById(referenceMetric.getSource());
        if (BooleanUtils.valueToBoolean(source.getIsAddress()) || source.getApplicationId() == Const.NONE_APPLICATION_ID) {
            filteredMetrics.add(referenceMetric);
        }
    });
    return filteredMetrics;
}
Also used : Application(org.apache.skywalking.apm.collector.storage.table.register.Application) LinkedList(java.util.LinkedList)

Example 7 with Application

use of org.apache.skywalking.apm.collector.storage.table.register.Application in project incubator-skywalking by apache.

the class ApplicationIDService method getOrCreateForApplicationCode.

@Override
public int getOrCreateForApplicationCode(String applicationCode) {
    int applicationId = getApplicationCacheService().getApplicationIdByCode(applicationCode);
    if (applicationId == 0) {
        Application application = new Application();
        application.setId(applicationCode);
        application.setApplicationCode(applicationCode);
        application.setApplicationId(0);
        application.setAddressId(Const.NONE);
        application.setIsAddress(BooleanUtils.FALSE);
        getApplicationRegisterGraph().start(application);
    }
    return applicationId;
}
Also used : Application(org.apache.skywalking.apm.collector.storage.table.register.Application)

Example 8 with Application

use of org.apache.skywalking.apm.collector.storage.table.register.Application in project incubator-skywalking by apache.

the class ApplicationIDService method getOrCreateForAddressId.

@Override
public int getOrCreateForAddressId(int addressId, String networkAddress) {
    int applicationId = getApplicationCacheService().getApplicationIdByAddressId(addressId);
    if (applicationId == 0) {
        Application application = new Application();
        application.setId(networkAddress);
        application.setApplicationCode(networkAddress);
        application.setApplicationId(0);
        application.setAddressId(addressId);
        application.setIsAddress(BooleanUtils.TRUE);
        getApplicationRegisterGraph().start(application);
    }
    return applicationId;
}
Also used : Application(org.apache.skywalking.apm.collector.storage.table.register.Application)

Example 9 with Application

use of org.apache.skywalking.apm.collector.storage.table.register.Application in project incubator-skywalking by apache.

the class ApplicationMetricAlarmAssertWorker method generateAlarmContent.

@Override
protected void generateAlarmContent(ApplicationAlarm alarm, double threshold) {
    Application application = applicationCacheService.getApplicationById(alarm.getApplicationId());
    String clientOrServer = "server";
    if (MetricSource.Caller.getValue() == alarm.getSourceValue()) {
        clientOrServer = "client";
    }
    if (AlarmType.ERROR_RATE.getValue() == alarm.getAlarmType()) {
        alarm.setAlarmContent("The success rate of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is lower than " + threshold + " rate.");
    } else if (AlarmType.SLOW_RTT.getValue() == alarm.getAlarmType()) {
        alarm.setAlarmContent("Response time of " + application.getApplicationCode() + ", detected from " + clientOrServer + " side, is slower than " + threshold + " ms.");
    }
}
Also used : Application(org.apache.skywalking.apm.collector.storage.table.register.Application)

Aggregations

Application (org.apache.skywalking.apm.collector.storage.table.register.Application)9 LinkedList (java.util.LinkedList)2 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 ParseException (java.text.ParseException)1 HashSet (java.util.HashSet)1 ElasticSearchClient (org.apache.skywalking.apm.collector.client.elasticsearch.ElasticSearchClient)1 H2Client (org.apache.skywalking.apm.collector.client.h2.H2Client)1 H2ClientException (org.apache.skywalking.apm.collector.client.h2.H2ClientException)1 Alarm (org.apache.skywalking.apm.collector.storage.ui.alarm.Alarm)1 ApplicationNode (org.apache.skywalking.apm.collector.storage.ui.application.ApplicationNode)1 ConjecturalNode (org.apache.skywalking.apm.collector.storage.ui.application.ConjecturalNode)1 Call (org.apache.skywalking.apm.collector.storage.ui.common.Call)1 Node (org.apache.skywalking.apm.collector.storage.ui.common.Node)1 Topology (org.apache.skywalking.apm.collector.storage.ui.common.Topology)1 VisualUserNode (org.apache.skywalking.apm.collector.storage.ui.common.VisualUserNode)1 GetRequestBuilder (org.elasticsearch.action.get.GetRequestBuilder)1 GetResponse (org.elasticsearch.action.get.GetResponse)1