public LongMetric createLongMetric(@NonNull final String metricName, final long metricValue, @NonNull final Map<String, String> additionalTags) { final LongMetric metric = new LongMetric(metricName, metricValue); metric.addTags(getBaseTags()); metric.addTags(additionalTags); this.metricSet.add(metric); return metric; }
public LongMetric createJobLongMetric(@NonNull final JobMetricType metricType, final long metricValue, @NonNull final Map<String, String> additionalTags) { final LongMetric metric = new LongMetric(getMetricName(metricType), metricValue); metric.addTags(getBaseTags()); metric.addTags(additionalTags); this.metricSet.add(metric); return metric; }
private void reportExecuteTime(@NonNull final IJobDagAction action, final long timeInMillis) { final LongMetric timeMetric = new LongMetric(TIME_METRIC, TimeUnit.MILLISECONDS.toSeconds(timeInMillis)); timeMetric.addTags(action.getMetricTags()); this.reporters.getReporters().stream().forEach(r -> r.gauge(timeMetric)); }
private void reportActionStatus(@NonNull final IJobDagAction action, final boolean isSuccess) { final LongMetric resultMetric = new LongMetric(RESULT_METRIC, isSuccess ? RESULT_SUCCESS : RESULT_FAILURE); resultMetric.addTags(action.getMetricTags()); this.reporters.getReporters().stream().forEach(r -> r.gauge(resultMetric)); } }
private void reportStatus(final boolean successful) { final long statusValue = successful ? DataFeedMetricNames.RESULT_SUCCESS : DataFeedMetricNames.RESULT_FAILURE; final LongMetric successMetric = new LongMetric( DataFeedMetricNames.RESULT, statusValue); successMetric.addTags(this.dataFeedMetrics.getBaseTags()); this.reporters.report(successMetric); } }