use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric in project incubator-skywalking by apache.
the class ServiceReferenceHourMetricTransformNode method process.
@Override
public void process(ServiceReferenceMetric serviceReferenceMetric, Next<ServiceReferenceMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.minuteToHour(serviceReferenceMetric.getTimeBucket());
ServiceReferenceMetric newServiceReferenceMetric = ServiceReferenceMetricCopy.copy(serviceReferenceMetric);
newServiceReferenceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + serviceReferenceMetric.getMetricId());
newServiceReferenceMetric.setTimeBucket(timeBucket);
next.execute(newServiceReferenceMetric);
}
use of org.apache.skywalking.apm.collector.storage.table.service.ServiceReferenceMetric 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);
}
Aggregations