Search in sources :

Example 6 with InstanceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric in project incubator-skywalking by apache.

the class InstanceReferenceMinuteMetricAggregationWorker method transform.

@Override
protected InstanceReferenceMetric transform(ServiceReferenceMetric serviceReferenceMetric) {
    String metricId = serviceReferenceMetric.getFrontInstanceId() + Const.ID_SPLIT + serviceReferenceMetric.getBehindInstanceId() + Const.ID_SPLIT + serviceReferenceMetric.getSourceValue();
    String id = serviceReferenceMetric.getTimeBucket() + Const.ID_SPLIT + metricId;
    InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric();
    instanceReferenceMetric.setId(id);
    instanceReferenceMetric.setMetricId(metricId);
    instanceReferenceMetric.setFrontApplicationId(serviceReferenceMetric.getFrontApplicationId());
    instanceReferenceMetric.setFrontInstanceId(serviceReferenceMetric.getFrontInstanceId());
    instanceReferenceMetric.setBehindApplicationId(serviceReferenceMetric.getBehindApplicationId());
    instanceReferenceMetric.setBehindInstanceId(serviceReferenceMetric.getBehindInstanceId());
    instanceReferenceMetric.setSourceValue(serviceReferenceMetric.getSourceValue());
    instanceReferenceMetric.setTransactionCalls(serviceReferenceMetric.getTransactionCalls());
    instanceReferenceMetric.setTransactionErrorCalls(serviceReferenceMetric.getTransactionErrorCalls());
    instanceReferenceMetric.setTransactionDurationSum(serviceReferenceMetric.getTransactionDurationSum());
    instanceReferenceMetric.setTransactionErrorDurationSum(serviceReferenceMetric.getTransactionErrorDurationSum());
    instanceReferenceMetric.setBusinessTransactionCalls(serviceReferenceMetric.getBusinessTransactionCalls());
    instanceReferenceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls());
    instanceReferenceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum());
    instanceReferenceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum());
    instanceReferenceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls());
    instanceReferenceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls());
    instanceReferenceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum());
    instanceReferenceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum());
    instanceReferenceMetric.setTimeBucket(serviceReferenceMetric.getTimeBucket());
    return instanceReferenceMetric;
}
Also used : InstanceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)

Example 7 with InstanceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric in project incubator-skywalking by apache.

the class AbstractInstanceReferenceMetricEsPersistenceDAO method esDataToStreamData.

@Override
protected final InstanceReferenceMetric esDataToStreamData(Map<String, Object> source) {
    InstanceReferenceMetric instanceReferenceMetric = new InstanceReferenceMetric();
    instanceReferenceMetric.setMetricId((String) source.get(InstanceReferenceMetricTable.COLUMN_METRIC_ID));
    instanceReferenceMetric.setFrontApplicationId((Integer) source.get(InstanceReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID));
    instanceReferenceMetric.setBehindApplicationId((Integer) source.get(InstanceReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID));
    instanceReferenceMetric.setFrontInstanceId((Integer) source.get(InstanceReferenceMetricTable.COLUMN_FRONT_INSTANCE_ID));
    instanceReferenceMetric.setBehindInstanceId((Integer) source.get(InstanceReferenceMetricTable.COLUMN_BEHIND_INSTANCE_ID));
    instanceReferenceMetric.setSourceValue((Integer) source.get(InstanceReferenceMetricTable.COLUMN_SOURCE_VALUE));
    instanceReferenceMetric.setTransactionCalls(((Number) source.get(InstanceReferenceMetricTable.COLUMN_TRANSACTION_CALLS)).longValue());
    instanceReferenceMetric.setTransactionErrorCalls(((Number) source.get(InstanceReferenceMetricTable.COLUMN_TRANSACTION_ERROR_CALLS)).longValue());
    instanceReferenceMetric.setTransactionDurationSum(((Number) source.get(InstanceReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM)).longValue());
    instanceReferenceMetric.setTransactionErrorDurationSum(((Number) source.get(InstanceReferenceMetricTable.COLUMN_TRANSACTION_ERROR_DURATION_SUM)).longValue());
    instanceReferenceMetric.setTransactionAverageDuration(((Number) source.get(InstanceReferenceMetricTable.COLUMN_TRANSACTION_AVERAGE_DURATION)).longValue());
    instanceReferenceMetric.setBusinessTransactionCalls(((Number) source.get(InstanceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_CALLS)).longValue());
    instanceReferenceMetric.setBusinessTransactionErrorCalls(((Number) source.get(InstanceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS)).longValue());
    instanceReferenceMetric.setBusinessTransactionDurationSum(((Number) source.get(InstanceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_DURATION_SUM)).longValue());
    instanceReferenceMetric.setBusinessTransactionErrorDurationSum(((Number) source.get(InstanceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM)).longValue());
    instanceReferenceMetric.setBusinessTransactionAverageDuration(((Number) source.get(InstanceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_AVERAGE_DURATION)).longValue());
    instanceReferenceMetric.setMqTransactionCalls(((Number) source.get(InstanceReferenceMetricTable.COLUMN_MQ_TRANSACTION_CALLS)).longValue());
    instanceReferenceMetric.setMqTransactionErrorCalls(((Number) source.get(InstanceReferenceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_CALLS)).longValue());
    instanceReferenceMetric.setMqTransactionDurationSum(((Number) source.get(InstanceReferenceMetricTable.COLUMN_MQ_TRANSACTION_DURATION_SUM)).longValue());
    instanceReferenceMetric.setMqTransactionErrorDurationSum(((Number) source.get(InstanceReferenceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM)).longValue());
    instanceReferenceMetric.setMqTransactionAverageDuration(((Number) source.get(InstanceReferenceMetricTable.COLUMN_MQ_TRANSACTION_AVERAGE_DURATION)).longValue());
    instanceReferenceMetric.setTimeBucket(((Number) source.get(InstanceReferenceMetricTable.COLUMN_TIME_BUCKET)).longValue());
    return instanceReferenceMetric;
}
Also used : InstanceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)

Example 8 with InstanceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric in project incubator-skywalking by apache.

the class InstanceReferenceHourMetricTransformNode method process.

@Override
public void process(InstanceReferenceMetric instanceReferenceMetric, Next<InstanceReferenceMetric> next) {
    long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(instanceReferenceMetric.getTimeBucket());
    InstanceReferenceMetric newInstanceReferenceMetric = InstanceReferenceMetricCopy.copy(instanceReferenceMetric);
    newInstanceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceReferenceMetric.getMetricId());
    newInstanceReferenceMetric.setTimeBucket(timeBucket);
    next.execute(newInstanceReferenceMetric);
}
Also used : InstanceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)

Example 9 with InstanceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric in project incubator-skywalking by apache.

the class InstanceReferenceMetricGraph method create.

public void create() {
    RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
    Graph<ServiceReferenceMetric> graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID, ServiceReferenceMetric.class);
    Node<InstanceReferenceMetric, InstanceReferenceMetric> remoteNode = graph.addNode(new InstanceReferenceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new InstanceReferenceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.INSTANCE_REFERENCE_METRIC_GRAPH_ID).create(workerCreateListener));
    remoteNode.addNext(new InstanceReferenceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    remoteNode.addNext(new InstanceReferenceHourMetricTransformNode()).addNext(new InstanceReferenceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    remoteNode.addNext(new InstanceReferenceDayMetricTransformNode()).addNext(new InstanceReferenceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    remoteNode.addNext(new InstanceReferenceMonthMetricTransformNode()).addNext(new InstanceReferenceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    link(graph);
}
Also used : RemoteSenderService(org.apache.skywalking.apm.collector.remote.service.RemoteSenderService) ServiceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric) InstanceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)

Example 10 with InstanceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric in project incubator-skywalking by apache.

the class InstanceReferenceDayMetricTransformNode method process.

@Override
public void process(InstanceReferenceMetric instanceReferenceMetric, Next<InstanceReferenceMetric> next) {
    long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(instanceReferenceMetric.getTimeBucket());
    InstanceReferenceMetric newInstanceReferenceMetric = InstanceReferenceMetricCopy.copy(instanceReferenceMetric);
    newInstanceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceReferenceMetric.getMetricId());
    newInstanceReferenceMetric.setTimeBucket(timeBucket);
    next.execute(newInstanceReferenceMetric);
}
Also used : InstanceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)

Aggregations

InstanceReferenceMetric (org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)11 RemoteSenderService (org.apache.skywalking.apm.collector.remote.service.RemoteSenderService)4 ApplicationReferenceMetric (org.apache.skywalking.apm.collector.storage.table.application.ApplicationReferenceMetric)1 InstanceMetric (org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric)1 ServiceReferenceMetric (org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric)1