@Test public void putClientMetrics() { List<Metric> metrics1 = Lists.newArrayList( Metric.from(MetricKey.CLIENT_BYTES_READ_LOCAL.getName() + ".192_1_1_1:A", 10, MetricType.COUNTER), Metric.from(MetricKey.CLIENT_BYTES_WRITTEN_LOCAL.getName() + ".192_1_1_1:A", 20, MetricType.COUNTER)); mMetricStore.putClientMetrics("192_1_1_1", metrics1); List<Metric> metrics2 = Lists.newArrayList( Metric.from(MetricKey.CLIENT_BYTES_READ_LOCAL.getName() + ".192_1_1_2:C", 1, MetricType.COUNTER)); mMetricStore.putClientMetrics("192_1_1_2", metrics2); List<Metric> metrics3 = Lists.newArrayList( Metric.from(MetricKey.CLIENT_BYTES_READ_LOCAL.getName() + ".192_1_1_1:B", 15, MetricType.COUNTER), Metric.from(MetricKey.CLIENT_BYTES_WRITTEN_LOCAL.getName() + ".192_1_1_1:B", 25, MetricType.COUNTER)); mMetricStore.putClientMetrics("192_1_1_1", metrics3); assertEquals(26, MetricsSystem.counter(MetricKey.CLUSTER_BYTES_READ_LOCAL.getName()).getCount()); assertEquals(45, MetricsSystem.counter(MetricKey.CLUSTER_BYTES_WRITTEN_LOCAL.getName()).getCount()); }
public void putClientMetrics(String source, List<Metric> metrics) { if (metrics.isEmpty() || source == null) { return; } try (LockResource r = new LockResource(mLock.readLock())) { putReportedMetrics(InstanceType.CLIENT, metrics); } LOG.debug("Put {} metrics of client {}", metrics.size(), source); }
MetricsStore { public void putClientMetrics(String source, List<Metric> metrics) { if (metrics.isEmpty() || source == null) { return; } try (LockResource r = new LockResource(mLock.readLock())) { putReportedMetrics(InstanceType.CLIENT, metrics); } LOG.debug("Put {} metrics of client {}", metrics.size(), source); } }
MetricsStore { public void putClientMetrics(String source, List<Metric> metrics) { if (metrics.isEmpty() || source == null) { return; } try (LockResource r = new LockResource(mLock.readLock())) { putReportedMetrics(InstanceType.CLIENT, metrics); } LOG.debug("Put {} metrics of client {}", metrics.size(), source); } MetricsStore(Clock clock); }
MetricsStore { public void putClientMetrics(String source, List<Metric> metrics) { if (metrics.isEmpty() || source == null) { return; } try (LockResource r = new LockResource(mLock.readLock())) { putReportedMetrics(InstanceType.CLIENT, metrics); } LOG.debug("Put {} metrics of client {}", metrics.size(), source); } MetricsStore(Clock clock); void putWorkerMetrics(String source, List<Metric> metrics); void putClientMetrics(String source, List<Metric> metrics); void initCounterKeys(); void clear(); long getLastClearTime(); }
MetricsStore { public void putClientMetrics(String source, List<Metric> metrics) { if (metrics.isEmpty() || source == null) { return; } try (LockResource r = new LockResource(mLock.readLock())) { putReportedMetrics(InstanceType.CLIENT, metrics); } LOG.debug("Put {} metrics of client {}", metrics.size(), source); } MetricsStore(Clock clock); void putWorkerMetrics(String source, List<Metric> metrics); void putClientMetrics(String source, List<Metric> metrics); void initCounterKeys(); void clear(); long getLastClearTime();  }