Search in sources :

Example 6 with ServiceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric in project incubator-skywalking by apache.

the class ServiceReferenceMetricAlarmGraph method create.

public void create() {
    RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
    Graph<ServiceReferenceMetric> graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID, ServiceReferenceMetric.class);
    graph.addNode(new ServiceReferenceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new ServiceReferenceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.SERVICE_REFERENCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)).addNext(new ServiceReferenceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    graph.toFinder().findNode(AlarmWorkerIdDefine.SERVICE_REFERENCE_METRIC_ALARM_REMOTE_WORKER_ID, ServiceReferenceAlarm.class).addNext(new ServiceReferenceMetricAlarmToListNodeProcessor()).addNext(new ServiceReferenceMetricAlarmListPersistenceWorker.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)

Example 7 with ServiceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric in project incubator-skywalking by apache.

the class AbstractServiceReferenceMetricH2PersistenceDAO method h2DataToStreamData.

@Override
protected final ServiceReferenceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException {
    ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric();
    serviceReferenceMetric.setId(resultSet.getString(ServiceReferenceMetricTable.COLUMN_ID));
    serviceReferenceMetric.setMetricId(resultSet.getString(ServiceReferenceMetricTable.COLUMN_METRIC_ID));
    serviceReferenceMetric.setFrontApplicationId(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_FRONT_APPLICATION_ID));
    serviceReferenceMetric.setBehindApplicationId(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_BEHIND_APPLICATION_ID));
    serviceReferenceMetric.setFrontInstanceId(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_FRONT_INSTANCE_ID));
    serviceReferenceMetric.setBehindInstanceId(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_BEHIND_INSTANCE_ID));
    serviceReferenceMetric.setFrontServiceId(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_FRONT_SERVICE_ID));
    serviceReferenceMetric.setBehindServiceId(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_BEHIND_SERVICE_ID));
    serviceReferenceMetric.setSourceValue(resultSet.getInt(ServiceReferenceMetricTable.COLUMN_SOURCE_VALUE));
    serviceReferenceMetric.setTransactionCalls(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_TRANSACTION_CALLS));
    serviceReferenceMetric.setTransactionErrorCalls(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_TRANSACTION_ERROR_CALLS));
    serviceReferenceMetric.setTransactionDurationSum(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_TRANSACTION_DURATION_SUM));
    serviceReferenceMetric.setTransactionErrorDurationSum(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_TRANSACTION_ERROR_DURATION_SUM));
    serviceReferenceMetric.setTransactionAverageDuration(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_TRANSACTION_AVERAGE_DURATION));
    serviceReferenceMetric.setBusinessTransactionCalls(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_CALLS));
    serviceReferenceMetric.setBusinessTransactionErrorCalls(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS));
    serviceReferenceMetric.setBusinessTransactionDurationSum(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_DURATION_SUM));
    serviceReferenceMetric.setBusinessTransactionErrorDurationSum(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM));
    serviceReferenceMetric.setBusinessTransactionAverageDuration(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_BUSINESS_TRANSACTION_AVERAGE_DURATION));
    serviceReferenceMetric.setMqTransactionCalls(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_MQ_TRANSACTION_CALLS));
    serviceReferenceMetric.setMqTransactionErrorCalls(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_CALLS));
    serviceReferenceMetric.setMqTransactionDurationSum(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_MQ_TRANSACTION_DURATION_SUM));
    serviceReferenceMetric.setMqTransactionErrorDurationSum(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM));
    serviceReferenceMetric.setMqTransactionAverageDuration(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_MQ_TRANSACTION_AVERAGE_DURATION));
    serviceReferenceMetric.setTimeBucket(resultSet.getLong(ServiceReferenceMetricTable.COLUMN_TIME_BUCKET));
    return serviceReferenceMetric;
}
Also used : ServiceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric)

Example 8 with ServiceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric in project incubator-skywalking by apache.

the class ServiceReferenceMonthMetricTransformNode method process.

@Override
public void process(ServiceReferenceMetric serviceReferenceMetric, Next<ServiceReferenceMetric> next) {
    long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(serviceReferenceMetric.getTimeBucket());
    ServiceReferenceMetric newServiceReferenceMetric = ServiceReferenceMetricCopy.copy(serviceReferenceMetric);
    newServiceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceReferenceMetric.getMetricId());
    newServiceReferenceMetric.setTimeBucket(timeBucket);
    next.execute(newServiceReferenceMetric);
}
Also used : ServiceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric)

Example 9 with ServiceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric in project incubator-skywalking by apache.

the class ServiceReferenceMetricSpanListener method parseEntry.

@Override
public void parseEntry(SpanDecorator spanDecorator, int applicationId, int instanceId, String segmentId) {
    if (spanDecorator.getRefsCount() > 0) {
        for (int i = 0; i < spanDecorator.getRefsCount(); i++) {
            ReferenceDecorator reference = spanDecorator.getRefs(i);
            ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric();
            serviceReferenceMetric.setFrontServiceId(reference.getParentServiceId());
            if (spanDecorator.getSpanLayer().equals(SpanLayer.MQ)) {
                int applicationIdByPeerId = applicationCacheService.getApplicationIdByAddressId(reference.getNetworkAddressId());
                int instanceIdByPeerId = instanceCacheService.getInstanceIdByAddressId(applicationIdByPeerId, reference.getNetworkAddressId());
                serviceReferenceMetric.setFrontInstanceId(instanceIdByPeerId);
                serviceReferenceMetric.setFrontApplicationId(applicationIdByPeerId);
            } else {
                serviceReferenceMetric.setFrontInstanceId(reference.getParentApplicationInstanceId());
                serviceReferenceMetric.setFrontApplicationId(instanceCacheService.getApplicationId(reference.getParentApplicationInstanceId()));
            }
            serviceReferenceMetric.setBehindServiceId(spanDecorator.getOperationNameId());
            serviceReferenceMetric.setBehindInstanceId(instanceId);
            serviceReferenceMetric.setBehindApplicationId(applicationId);
            serviceReferenceMetric.setSourceValue(MetricSource.Callee.getValue());
            calculateDuration(serviceReferenceMetric, spanDecorator);
            entryReferenceMetric.add(serviceReferenceMetric);
        }
    } else {
        ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric();
        serviceReferenceMetric.setFrontServiceId(Const.NONE_SERVICE_ID);
        serviceReferenceMetric.setFrontInstanceId(Const.NONE_INSTANCE_ID);
        serviceReferenceMetric.setFrontApplicationId(Const.NONE_APPLICATION_ID);
        serviceReferenceMetric.setBehindServiceId(spanDecorator.getOperationNameId());
        serviceReferenceMetric.setBehindInstanceId(instanceId);
        serviceReferenceMetric.setBehindApplicationId(applicationId);
        serviceReferenceMetric.setSourceValue(MetricSource.Callee.getValue());
        calculateDuration(serviceReferenceMetric, spanDecorator);
        entryReferenceMetric.add(serviceReferenceMetric);
    }
    this.entrySpanDecorator = spanDecorator;
}
Also used : ServiceReferenceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric) ReferenceDecorator(org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator)

Example 10 with ServiceReferenceMetric

use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric in project incubator-skywalking by apache.

the class ServiceReferenceDayMetricTransformNode method process.

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

Aggregations

ServiceReferenceMetric (org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric)12 RemoteSenderService (org.apache.skywalking.apm.collector.remote.service.RemoteSenderService)4 ReferenceDecorator (org.apache.skywalking.apm.collector.analysis.segment.parser.define.decorator.ReferenceDecorator)1 InstanceReferenceMetric (org.apache.skywalking.apm.collector.storage.table.instance.InstanceReferenceMetric)1 ServiceMetric (org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)1