@Override public void gauge(String metricName, long value) { metricsContext.gauge(metricName, value); } }
@Override public MetricsContext load(Map<String, String> key) throws Exception { return metricsContext.childContext(key); } });
@Override public MetricsContext load(Map<String, String> key) throws Exception { return metricsCollectionService.getContext(key); } });
/** * query the metric store and return the Collection<MetricTimeSeries> * @param query * @return Collection<MetricTimeSeries> */ public Collection<MetricTimeSeries> query(MetricDataQuery query) { return metricStore.query(query); }
@Override public Integer call(Integer val) throws Exception { int newVal = val * 10; if (newVal > 30) { metrics.count("more.than.30", 1); } return newVal; } }).collect();
private void gauge(Map<String, String> context, String metric, long timestamp, Long value) throws Exception { metricStore.add(new MetricValues(context, metric, timestamp, value, MetricType.GAUGE)); }
/** * Search the metric store and return the collection of metric names available for the tag-values in search query * @param query * @return Collection of metric names */ public Collection<String> searchMetricNames(MetricSearchQuery query) { return metricStore.findMetricNames(query); }
private void reportWrite(int numOps, int dataSize) { if (metricsCollector != null) { metricsCollector.increment(Constants.Metrics.Name.Dataset.WRITE_COUNT, numOps); metricsCollector.increment(Constants.Metrics.Name.Dataset.WRITE_BYTES, dataSize); metricsCollector.increment(Constants.Metrics.Name.Dataset.OP_COUNT, numOps); } }
/** * Search the metric store and return the collection of next available tags for the search query * @param query * @return Collection of tag values */ public Collection<TagValue> searchTags(MetricSearchQuery query) { return metricStore.findNextAvailableTags(query); }
/** * deletes all metrics */ public void resetAll() { metricStore.deleteAll(); }
@Override public MetricsContext load(NamespaceId namespaceId) { return metricsCollectionService.getContext(getStreamMetricsContext(namespaceId)); } });
@Override public MetricsContext load(Map<String, String> key) throws Exception { return metricsContext.childContext(key); } });
/** * Search the metric store and return the collection of next available tags for the search query * @param query * @return Collection of tag values */ public Collection<TagValue> searchTags(MetricSearchQuery query) { return metricStore.findNextAvailableTags(query); }
/** * deletes all metrics */ public void resetAll() { metricStore.deleteAll(); }
@Override public MetricsContext load(Map<String, String> key) throws Exception { return metricsCollectionService.getContext(key); } });
private void incrementMetric(String metricName, long value) { if (metrics != null) { metrics.increment(metricName, value); } }