use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric in project incubator-skywalking by apache.
the class InstanceDayMetricTransformNode method process.
@Override
public void process(InstanceMetric instanceMetric, Next<InstanceMetric> next) {
long timeBucket = TimeBucketUtils.INSTANCE.minuteToDay(instanceMetric.getTimeBucket());
InstanceMetric newInstanceMetric = InstanceMetricCopy.copy(instanceMetric);
newInstanceMetric.setId(String.valueOf(timeBucket) + Const.ID_SPLIT + instanceMetric.getMetricId());
newInstanceMetric.setTimeBucket(timeBucket);
next.execute(newInstanceMetric);
}
use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric in project incubator-skywalking by apache.
the class InstanceMinuteMetricAggregationWorker method transform.
@Override
protected InstanceMetric transform(InstanceReferenceMetric instanceReferenceMetric) {
String metricId = instanceReferenceMetric.getBehindInstanceId() + Const.ID_SPLIT + instanceReferenceMetric.getSourceValue();
String id = instanceReferenceMetric.getTimeBucket() + Const.ID_SPLIT + metricId;
InstanceMetric instanceMetric = new InstanceMetric();
instanceMetric.setId(id);
instanceMetric.setMetricId(metricId);
instanceMetric.setApplicationId(instanceReferenceMetric.getBehindApplicationId());
instanceMetric.setInstanceId(instanceReferenceMetric.getBehindInstanceId());
instanceMetric.setSourceValue(instanceReferenceMetric.getSourceValue());
instanceMetric.setTransactionCalls(instanceReferenceMetric.getTransactionCalls());
instanceMetric.setTransactionErrorCalls(instanceReferenceMetric.getTransactionErrorCalls());
instanceMetric.setTransactionDurationSum(instanceReferenceMetric.getTransactionDurationSum());
instanceMetric.setTransactionErrorDurationSum(instanceReferenceMetric.getTransactionErrorDurationSum());
instanceMetric.setBusinessTransactionCalls(instanceReferenceMetric.getBusinessTransactionCalls());
instanceMetric.setBusinessTransactionErrorCalls(instanceReferenceMetric.getBusinessTransactionErrorCalls());
instanceMetric.setBusinessTransactionDurationSum(instanceReferenceMetric.getBusinessTransactionDurationSum());
instanceMetric.setBusinessTransactionErrorDurationSum(instanceReferenceMetric.getBusinessTransactionErrorDurationSum());
instanceMetric.setMqTransactionCalls(instanceReferenceMetric.getMqTransactionCalls());
instanceMetric.setMqTransactionErrorCalls(instanceReferenceMetric.getMqTransactionErrorCalls());
instanceMetric.setMqTransactionDurationSum(instanceReferenceMetric.getMqTransactionDurationSum());
instanceMetric.setMqTransactionErrorDurationSum(instanceReferenceMetric.getMqTransactionErrorDurationSum());
instanceMetric.setTimeBucket(instanceReferenceMetric.getTimeBucket());
return instanceMetric;
}
use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric in project incubator-skywalking by apache.
the class AbstractInstanceMetricH2PersistenceDAO method h2DataToStreamData.
@Override
protected final InstanceMetric h2DataToStreamData(ResultSet resultSet) throws SQLException {
InstanceMetric instanceMetric = new InstanceMetric();
instanceMetric.setId(resultSet.getString(InstanceMetricTable.COLUMN_ID));
instanceMetric.setMetricId(resultSet.getString(InstanceMetricTable.COLUMN_METRIC_ID));
instanceMetric.setApplicationId(resultSet.getInt(InstanceMetricTable.COLUMN_APPLICATION_ID));
instanceMetric.setInstanceId(resultSet.getInt(InstanceMetricTable.COLUMN_INSTANCE_ID));
instanceMetric.setSourceValue(resultSet.getInt(InstanceMetricTable.COLUMN_SOURCE_VALUE));
instanceMetric.setTransactionCalls(resultSet.getLong(InstanceMetricTable.COLUMN_TRANSACTION_CALLS));
instanceMetric.setTransactionErrorCalls(resultSet.getLong(InstanceMetricTable.COLUMN_TRANSACTION_ERROR_CALLS));
instanceMetric.setTransactionDurationSum(resultSet.getLong(InstanceMetricTable.COLUMN_TRANSACTION_DURATION_SUM));
instanceMetric.setTransactionErrorDurationSum(resultSet.getLong(InstanceMetricTable.COLUMN_TRANSACTION_ERROR_DURATION_SUM));
instanceMetric.setTransactionAverageDuration(resultSet.getLong(InstanceMetricTable.COLUMN_TRANSACTION_AVERAGE_DURATION));
instanceMetric.setBusinessTransactionCalls(resultSet.getLong(InstanceMetricTable.COLUMN_BUSINESS_TRANSACTION_CALLS));
instanceMetric.setBusinessTransactionErrorCalls(resultSet.getLong(InstanceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS));
instanceMetric.setBusinessTransactionDurationSum(resultSet.getLong(InstanceMetricTable.COLUMN_BUSINESS_TRANSACTION_DURATION_SUM));
instanceMetric.setBusinessTransactionErrorDurationSum(resultSet.getLong(InstanceMetricTable.COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM));
instanceMetric.setBusinessTransactionAverageDuration(resultSet.getLong(InstanceMetricTable.COLUMN_BUSINESS_TRANSACTION_AVERAGE_DURATION));
instanceMetric.setMqTransactionCalls(resultSet.getLong(InstanceMetricTable.COLUMN_MQ_TRANSACTION_CALLS));
instanceMetric.setMqTransactionErrorCalls(resultSet.getLong(InstanceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_CALLS));
instanceMetric.setMqTransactionDurationSum(resultSet.getLong(InstanceMetricTable.COLUMN_MQ_TRANSACTION_DURATION_SUM));
instanceMetric.setMqTransactionErrorDurationSum(resultSet.getLong(InstanceMetricTable.COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM));
instanceMetric.setMqTransactionAverageDuration(resultSet.getLong(InstanceMetricTable.COLUMN_MQ_TRANSACTION_AVERAGE_DURATION));
instanceMetric.setTimeBucket(resultSet.getLong(InstanceMetricTable.COLUMN_TIME_BUCKET));
return instanceMetric;
}
use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric in project incubator-skywalking by apache.
the class InstanceMetricAlarmGraph method create.
public void create() {
RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
Graph<InstanceMetric> graph = GraphManager.INSTANCE.createIfAbsent(AlarmGraphIdDefine.INSTANCE_METRIC_ALARM_GRAPH_ID, InstanceMetric.class);
graph.addNode(new InstanceMetricAlarmAssertWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new InstanceMetricAlarmRemoteWorker.Factory(moduleManager, remoteSenderService, AlarmGraphIdDefine.INSTANCE_METRIC_ALARM_GRAPH_ID).create(workerCreateListener)).addNext(new InstanceMetricAlarmPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
graph.toFinder().findNode(AlarmWorkerIdDefine.INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID, InstanceAlarm.class).addNext(new InstanceMetricAlarmToListNodeProcessor()).addNext(new InstanceMetricAlarmListPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
link(graph);
}
use of org.apache.skywalking.apm.collector.storage.table.instance.InstanceMetric in project incubator-skywalking by apache.
the class InstanceMetricGraph method create.
public void create() {
RemoteSenderService remoteSenderService = moduleManager.find(RemoteModule.NAME).getService(RemoteSenderService.class);
Graph<InstanceReferenceMetric> graph = GraphManager.INSTANCE.createIfAbsent(MetricGraphIdDefine.INSTANCE_METRIC_GRAPH_ID, InstanceReferenceMetric.class);
Node<InstanceMetric, InstanceMetric> remoteNode = graph.addNode(new InstanceMinuteMetricAggregationWorker.Factory(moduleManager).create(workerCreateListener)).addNext(new InstanceMinuteMetricRemoteWorker.Factory(moduleManager, remoteSenderService, MetricGraphIdDefine.INSTANCE_METRIC_GRAPH_ID).create(workerCreateListener));
remoteNode.addNext(new InstanceMinuteMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
remoteNode.addNext(new InstanceHourMetricTransformNode()).addNext(new InstanceHourMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
remoteNode.addNext(new InstanceDayMetricTransformNode()).addNext(new InstanceDayMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
remoteNode.addNext(new InstanceMonthMetricTransformNode()).addNext(new InstanceMonthMetricPersistenceWorker.Factory(moduleManager).create(workerCreateListener));
link(graph);
}
Aggregations