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