Search in sources :

Example 6 with ServiceMetric

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

the class AbstractServiceMetricH2PersistenceDAO method h2DataToStreamData.

@Override
protected final ServiceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException {
    ServiceMetric serviceMetric = new ServiceMetric();
    serviceMetric.setId(resultSet.getString(ServiceMetricTable.COLUMN_ID));
    serviceMetric.setMetricId(resultSet.getString(ServiceMetricTable.COLUMN_METRIC_ID));
    serviceMetric.setApplicationId(resultSet.getInt(ServiceMetricTable.COLUMN_APPLICATION_ID));
    serviceMetric.setInstanceId(resultSet.getInt(ServiceMetricTable.COLUMN_INSTANCE_ID));
    serviceMetric.setServiceId(resultSet.getInt(ServiceMetricTable.COLUMN_SERVICE_ID));
    serviceMetric.setSourceValue(resultSet.getInt(ServiceMetricTable.COLUMN_SOURCE_VALUE));
    serviceMetric.setTransactionCalls(resultSet.getLong(ServiceMetricTable.COLUMN_TRANSACTION_CALLS));
    serviceMetric.setTransactionErrorCalls(resultSet.getLong(ServiceMetricTable.COLUMN_TRANSACTION_ERROR_CALLS));
    serviceMetric.setTransactionDurationSum(resultSet.getLong(ServiceMetricTable.COLUMN_TRANSACTION_DURATION_SUM));
    serviceMetric.setTransactionErrorDurationSum(resultSet.getLong(ServiceMetricTable.COLUMN_TRANSACTION_ERROR_DURATION_SUM));
    serviceMetric.setTransactionAverageDuration(resultSet.getLong(ServiceMetricTable.COLUMN_TRANSACTION_AVERAGE_DURATION));
    serviceMetric.setBusinessTransactionCalls(resultSet.getLong(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_CALLS));
    serviceMetric.setBusinessTransactionErrorCalls(resultSet.getLong(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS));
    serviceMetric.setBusinessTransactionDurationSum(resultSet.getLong(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_DURATION_SUM));
    serviceMetric.setBusinessTransactionErrorDurationSum(resultSet.getLong(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM));
    serviceMetric.setBusinessTransactionAverageDuration(resultSet.getLong(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_AVERAGE_DURATION));
    serviceMetric.setMqTransactionCalls(resultSet.getLong(ServiceMetricTable.COLUMN_MQ_TRANSACTION_CALLS));
    serviceMetric.setMqTransactionErrorCalls(resultSet.getLong(ServiceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_CALLS));
    serviceMetric.setMqTransactionDurationSum(resultSet.getLong(ServiceMetricTable.COLUMN_MQ_TRANSACTION_DURATION_SUM));
    serviceMetric.setMqTransactionErrorDurationSum(resultSet.getLong(ServiceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM));
    serviceMetric.setMqTransactionAverageDuration(resultSet.getLong(ServiceMetricTable.COLUMN_MQ_TRANSACTION_AVERAGE_DURATION));
    serviceMetric.setTimeBucket(resultSet.getLong(ServiceMetricTable.COLUMN_TIME_BUCKET));
    return serviceMetric;
}
Also used : ServiceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)

Example 7 with ServiceMetric

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

the class ServiceMetricCopy method copy.

public static ServiceMetric copy(ServiceMetric serviceMetric) {
    ServiceMetric newServiceMetric = new ServiceMetric();
    newServiceMetric.setId(serviceMetric.getId());
    newServiceMetric.setMetricId(serviceMetric.getMetricId());
    newServiceMetric.setSourceValue(serviceMetric.getSourceValue());
    newServiceMetric.setApplicationId(serviceMetric.getApplicationId());
    newServiceMetric.setInstanceId(serviceMetric.getInstanceId());
    newServiceMetric.setServiceId(serviceMetric.getServiceId());
    newServiceMetric.setTransactionCalls(serviceMetric.getTransactionCalls());
    newServiceMetric.setTransactionDurationSum(serviceMetric.getTransactionDurationSum());
    newServiceMetric.setTransactionErrorCalls(serviceMetric.getTransactionErrorCalls());
    newServiceMetric.setTransactionErrorDurationSum(serviceMetric.getTransactionErrorDurationSum());
    newServiceMetric.setBusinessTransactionCalls(serviceMetric.getBusinessTransactionCalls());
    newServiceMetric.setBusinessTransactionDurationSum(serviceMetric.getBusinessTransactionDurationSum());
    newServiceMetric.setBusinessTransactionErrorCalls(serviceMetric.getBusinessTransactionErrorCalls());
    newServiceMetric.setBusinessTransactionErrorDurationSum(serviceMetric.getBusinessTransactionErrorDurationSum());
    newServiceMetric.setMqTransactionCalls(serviceMetric.getMqTransactionCalls());
    newServiceMetric.setMqTransactionDurationSum(serviceMetric.getMqTransactionDurationSum());
    newServiceMetric.setMqTransactionErrorCalls(serviceMetric.getMqTransactionErrorCalls());
    newServiceMetric.setMqTransactionErrorDurationSum(serviceMetric.getMqTransactionErrorDurationSum());
    newServiceMetric.setTimeBucket(serviceMetric.getTimeBucket());
    return newServiceMetric;
}
Also used : ServiceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)

Example 8 with ServiceMetric

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

the class ServiceHourMetricTransformNode method process.

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

Example 9 with ServiceMetric

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

the class ServiceMetricAlarmGraph method create.

public void create() {
    RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
    Graph<ServiceMetric> graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.SERVICE_METRIC_ALARM_GRAPH_ID, ServiceMetric.class);
    graph.addNode(new ServiceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new ServiceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.SERVICE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)).addNext(new ServiceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    graph.toFinder().findNode(AlarmWorkerIdDefine.SERVICE_METRIC_ALARM_REMOTE_WORKER_ID, ServiceAlarm.class).addNext(new ServiceMetricAlarmToListNodeProcessor()).addNext(new ServiceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    link(graph);
}
Also used : RemoteSenderService(org.apache.skywalking.apm.collector.remote.service.RemoteSenderService) ServiceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)

Aggregations

ServiceMetric (org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)9 RemoteSenderService (org.apache.skywalking.apm.collector.remote.service.RemoteSenderService)2 ServiceReferenceMetric (org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric)1