use of org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric in project incubator-skywalking by apache.
the class ApplicationReferenceHourMetricTransformNode method process.
@Override
public void process(ApplicationReferenceMetric applicationReferenceMetric, Next<ApplicationReferenceMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(applicationReferenceMetric.getTimeBucket());
ApplicationReferenceMetric newApplicationReferenceMetric = ApplicationReferenceMetricCopy.copy(applicationReferenceMetric);
newApplicationReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationReferenceMetric.getMetricId());
newApplicationReferenceMetric.setTimeBucket(timeBucket);
next.execute(newApplicationReferenceMetric);
}
use of org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric in project incubator-skywalking by apache.
the class ApplicationReferenceMetricGraph method create.
public void create() {
RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
Graph<InstanceReferenceMetric> graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class);
Node<ApplicationReferenceMetric, ApplicationReferenceMetric> remoteNode = graph.addNode(new ApplicationReferenceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new ApplicationReferenceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.APPLICATION_REFERENCE_METRIC_GRAPH_ID).create(workerCreateListener));
remoteNode.addNext(new ApplicationReferenceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
remoteNode.addNext(new ApplicationReferenceHourMetricTransformNode()).addNext(new ApplicationReferenceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
remoteNode.addNext(new ApplicationReferenceDayMetricTransformNode()).addNext(new ApplicationReferenceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
remoteNode.addNext(new ApplicationReferenceMonthMetricTransformNode()).addNext(new ApplicationReferenceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
link(graph);
}
use of org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric in project incubator-skywalking by apache.
the class ApplicationReferenceMinuteMetricAggregationWorker method transform.
@Override
protected ApplicationReferenceMetric transform(InstanceReferenceMetric instanceReferenceMetric) {
Integer frontApplicationId = instanceCacheService.getApplicationId(instanceReferenceMetric.getFrontInstanceId());
Integer behindApplicationId = instanceCacheService.getApplicationId(instanceReferenceMetric.getBehindInstanceId());
String metricId = frontApplicationId + Const.ID_SPLIT + behindApplicationId + Const.ID_SPLIT + instanceReferenceMetric.getSourceValue();
String id = instanceReferenceMetric.getTimeBucket() + Const.ID_SPLIT + metricId;
ApplicationReferenceMetric applicationReferenceMetric = new ApplicationReferenceMetric();
applicationReferenceMetric.setId(id);
applicationReferenceMetric.setMetricId(metricId);
applicationReferenceMetric.setFrontApplicationId(frontApplicationId);
applicationReferenceMetric.setBehindApplicationId(behindApplicationId);
applicationReferenceMetric.setSourceValue(instanceReferenceMetric.getSourceValue());
applicationReferenceMetric.setTransactionCalls(instanceReferenceMetric.getTransactionCalls());
applicationReferenceMetric.setTransactionErrorCalls(instanceReferenceMetric.getTransactionErrorCalls());
applicationReferenceMetric.setTransactionDurationSum(instanceReferenceMetric.getTransactionDurationSum());
applicationReferenceMetric.setTransactionErrorDurationSum(instanceReferenceMetric.getTransactionErrorDurationSum());
applicationReferenceMetric.setBusinessTransactionCalls(instanceReferenceMetric.getBusinessTransactionCalls());
applicationReferenceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls());
applicationReferenceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum());
applicationReferenceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum());
applicationReferenceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls());
applicationReferenceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls());
applicationReferenceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum());
applicationReferenceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum());
ApdexThresholdUtils.Apdex apdex = ApdexThresholdUtils.compute(apdexThresholdService.getApplicationApdexThreshold(behindApplicationId), instanceReferenceMetric.getTransactionDurationSum());
if (ApdexThresholdUtils.Apdex.Satisfied.equals(apdex)) {
applicationReferenceMetric.setSatisfiedCount(1L);
} else if (ApdexThresholdUtils.Apdex.Tolerating.equals(apdex)) {
applicationReferenceMetric.setToleratingCount(1L);
} else {
applicationReferenceMetric.setFrustratedCount(1L);
}
applicationReferenceMetric.setTimeBucket(instanceReferenceMetric.getTimeBucket());
return applicationReferenceMetric;
}
use of org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric in project incubator-skywalking by apache.
the class ApplicationReferenceMonthMetricTransformNode method process.
@Override
public void process(ApplicationReferenceMetric applicationReferenceMetric, Next<ApplicationReferenceMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(applicationReferenceMetric.getTimeBucket());
ApplicationReferenceMetric newApplicationReferenceMetric = ApplicationReferenceMetricCopy.copy(applicationReferenceMetric);
newApplicationReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + applicationReferenceMetric.getMetricId());
newApplicationReferenceMetric.setTimeBucket(timeBucket);
next.execute(newApplicationReferenceMetric);
}
use of org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric in project incubator-skywalking by apache.
the class AbstractApplicationReferenceMetricEsPersistenceDAO method esDataToStreamData.
@Override
protected final ApplicationReferenceMetric esDataToStreamData(Map<String, Object> source) {
ApplicationReferenceMetric applicationReferenceMetric = new ApplicationReferenceMetric();
applicationReferenceMetric.setMetricId((String) source.get(ApplicationReferenceMetricTable.COLUMN_METRIC_ID));
applicationReferenceMetric.setFrontApplicationId(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID)).intValue());
applicationReferenceMetric.setBehindApplicationId(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID)).intValue());
applicationReferenceMetric.setSourceValue(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_SOURCE_VALUE)).intValue());
applicationReferenceMetric.setTransactionCalls(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_CALLS)).longValue());
applicationReferenceMetric.setTransactionErrorCalls(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_ERROR_CALLS)).longValue());
applicationReferenceMetric.setTransactionDurationSum(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM)).longValue());
applicationReferenceMetric.setTransactionErrorDurationSum(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_ERROR_DURATION_SUM)).longValue());
applicationReferenceMetric.setTransactionAverageDuration(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TRANSACTION_AVERAGE_DURATION)).longValue());
applicationReferenceMetric.setBusinessTransactionCalls(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_CALLS)).longValue());
applicationReferenceMetric.setBusinessTransactionErrorCalls(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS)).longValue());
applicationReferenceMetric.setBusinessTransactionDurationSum(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_DURATION_SUM)).longValue());
applicationReferenceMetric.setBusinessTransactionErrorDurationSum(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM)).longValue());
applicationReferenceMetric.setBusinessTransactionAverageDuration(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_AVERAGE_DURATION)).longValue());
applicationReferenceMetric.setMqTransactionCalls(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_MQ_TRANSACTION_CALLS)).longValue());
applicationReferenceMetric.setMqTransactionErrorCalls(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_CALLS)).longValue());
applicationReferenceMetric.setMqTransactionDurationSum(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_MQ_TRANSACTION_DURATION_SUM)).longValue());
applicationReferenceMetric.setMqTransactionErrorDurationSum(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM)).longValue());
applicationReferenceMetric.setMqTransactionAverageDuration(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_MQ_TRANSACTION_AVERAGE_DURATION)).longValue());
applicationReferenceMetric.setSatisfiedCount(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_SATISFIED_COUNT)).longValue());
applicationReferenceMetric.setToleratingCount(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TOLERATING_COUNT)).longValue());
applicationReferenceMetric.setFrustratedCount(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_FRUSTRATED_COUNT)).longValue());
applicationReferenceMetric.setTimeBucket(((Number) source.get(ApplicationReferenceMetricTable.COLUMN_TIME_BUCKET)).longValue());
return applicationReferenceMetric;
}
Aggregations