Search in sources :

Example 1 with ServiceMetric

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

the class ServiceDayMetricTransformNode method process.

@Override
public void process(ServiceMetric serviceMetric, Next<ServiceMetric> next) {
    long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(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 2 with ServiceMetric

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

the class ServiceMetricGraph method create.

public void create() {
    RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
    Graph<ServiceReferenceMetric> graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.SERVICE_METRIC_GRAPH_ID, ServiceReferenceMetric.class);
    Node<ServiceMetric, ServiceMetric> remoteNode = graph.addNode(new ServiceMetricMinuteAggregationWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new ServiceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.SERVICE_METRIC_GRAPH_ID).create(workerCreateListener));
    remoteNode.addNext(new ServiceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    remoteNode.addNext(new ServiceHourMetricTransformNode()).addNext(new ServiceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    remoteNode.addNext(new ServiceDayMetricTransformNode()).addNext(new ServiceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
    remoteNode.addNext(new ServiceMonthMetricTransformNode()).addNext(new ServiceMonthMetricPersistenceWorker.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) ServiceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)

Example 3 with ServiceMetric

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

the class ServiceMetricMinuteAggregationWorker method transform.

@Override
protected ServiceMetric transform(ServiceReferenceMetric serviceReferenceMetric) {
    Integer serviceId = serviceReferenceMetric.getBehindServiceId();
    Long timeBucket = serviceReferenceMetric.getTimeBucket();
    Integer sourceValue = serviceReferenceMetric.getSourceValue();
    String metricId = String.valueOf(serviceId) + Const.ID_SPLIT + String.valueOf(sourceValue);
    String id = String.valueOf(timeBucket) + Const.ID_SPLIT + metricId;
    ServiceMetric serviceMetric = new ServiceMetric();
    serviceMetric.setId(id);
    serviceMetric.setMetricId(metricId);
    serviceMetric.setApplicationId(serviceReferenceMetric.getBehindApplicationId());
    serviceMetric.setInstanceId(serviceReferenceMetric.getBehindInstanceId());
    serviceMetric.setServiceId(serviceId);
    serviceMetric.setSourceValue(sourceValue);
    serviceMetric.setTransactionCalls(serviceReferenceMetric.getTransactionCalls());
    serviceMetric.setTransactionDurationSum(serviceReferenceMetric.getTransactionDurationSum());
    serviceMetric.setTransactionErrorCalls(serviceReferenceMetric.getTransactionErrorCalls());
    serviceMetric.setTransactionErrorDurationSum(serviceReferenceMetric.getTransactionErrorDurationSum());
    serviceMetric.setBusinessTransactionCalls(serviceReferenceMetric.getBusinessTransactionCalls());
    serviceMetric.setBusinessTransactionDurationSum(serviceReferenceMetric.getBusinessTransactionDurationSum());
    serviceMetric.setBusinessTransactionErrorCalls(serviceReferenceMetric.getBusinessTransactionErrorCalls());
    serviceMetric.setBusinessTransactionErrorDurationSum(serviceReferenceMetric.getBusinessTransactionErrorDurationSum());
    serviceMetric.setMqTransactionCalls(serviceReferenceMetric.getMqTransactionCalls());
    serviceMetric.setMqTransactionDurationSum(serviceReferenceMetric.getMqTransactionDurationSum());
    serviceMetric.setMqTransactionErrorCalls(serviceReferenceMetric.getMqTransactionErrorCalls());
    serviceMetric.setMqTransactionErrorDurationSum(serviceReferenceMetric.getMqTransactionErrorDurationSum());
    serviceMetric.setTimeBucket(timeBucket);
    return serviceMetric;
}
Also used : ServiceMetric(org.apache.skywalking.apm.collector.storage.table.service.ServiceMetric)

Example 4 with ServiceMetric

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

the class ServiceMonthMetricTransformNode method process.

@Override
public void process(ServiceMetric serviceMetric, Next<ServiceMetric> next) {
    long timeBucket = TimeBucketUtils.INSTANCE.minuteToMonth(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 5 with ServiceMetric

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

the class AbstractServiceMetricEsPersistenceDAO method esDataToStreamData.

@Override
protected final ServiceMetric esDataToStreamData(Map<String, Object> source) {
    ServiceMetric serviceMetric = new ServiceMetric();
    serviceMetric.setMetricId((String) source.get(ServiceMetricTable.COLUMN_METRIC_ID));
    serviceMetric.setApplicationId(((Number) source.get(ServiceMetricTable.COLUMN_APPLICATION_ID)).intValue());
    serviceMetric.setInstanceId(((Number) source.get(ServiceMetricTable.COLUMN_INSTANCE_ID)).intValue());
    serviceMetric.setServiceId(((Number) source.get(ServiceMetricTable.COLUMN_SERVICE_ID)).intValue());
    serviceMetric.setSourceValue(((Number) source.get(ServiceMetricTable.COLUMN_SOURCE_VALUE)).intValue());
    serviceMetric.setTransactionCalls(((Number) source.get(ServiceMetricTable.COLUMN_TRANSACTION_CALLS)).longValue());
    serviceMetric.setTransactionErrorCalls(((Number) source.get(ServiceMetricTable.COLUMN_TRANSACTION_ERROR_CALLS)).longValue());
    serviceMetric.setTransactionDurationSum(((Number) source.get(ServiceMetricTable.COLUMN_TRANSACTION_DURATION_SUM)).longValue());
    serviceMetric.setTransactionErrorDurationSum(((Number) source.get(ServiceMetricTable.COLUMN_TRANSACTION_ERROR_DURATION_SUM)).longValue());
    serviceMetric.setTransactionAverageDuration(((Number) source.get(ServiceMetricTable.COLUMN_TRANSACTION_AVERAGE_DURATION)).longValue());
    serviceMetric.setBusinessTransactionCalls(((Number) source.get(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_CALLS)).longValue());
    serviceMetric.setBusinessTransactionErrorCalls(((Number) source.get(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS)).longValue());
    serviceMetric.setBusinessTransactionDurationSum(((Number) source.get(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_DURATION_SUM)).longValue());
    serviceMetric.setBusinessTransactionErrorDurationSum(((Number) source.get(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM)).longValue());
    serviceMetric.setBusinessTransactionAverageDuration(((Number) source.get(ServiceMetricTable.COLUMN_BUSINESS_TRANSACTION_AVERAGE_DURATION)).longValue());
    serviceMetric.setMqTransactionCalls(((Number) source.get(ServiceMetricTable.COLUMN_MQ_TRANSACTION_CALLS)).longValue());
    serviceMetric.setMqTransactionErrorCalls(((Number) source.get(ServiceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_CALLS)).longValue());
    serviceMetric.setMqTransactionDurationSum(((Number) source.get(ServiceMetricTable.COLUMN_MQ_TRANSACTION_DURATION_SUM)).longValue());
    serviceMetric.setMqTransactionErrorDurationSum(((Number) source.get(ServiceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM)).longValue());
    serviceMetric.setMqTransactionAverageDuration(((Number) source.get(ServiceMetricTable.COLUMN_MQ_TRANSACTION_AVERAGE_DURATION)).longValue());
    serviceMetric.setTimeBucket(((Number) source.get(ServiceMetricTable.COLUMN_TIME_BUCKET)).longValue());
    return serviceMetric;
}
Also used : 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