@Override public void mark(long n) { super.mark(n); if (this.parentMeter.isPresent()) { this.parentMeter.get().mark(n); } }
@Override public DistributeJobResult call() throws Exception { String planningId = getPlanningJobId(this.jobPlanningProps); JobConfig.Builder builder = createJobBuilder(this.jobPlanningProps); try { long submitStartTime = System.currentTimeMillis(); GobblinHelixDistributeJobExecutionLauncher.this.helixMetrics.submitMeter.mark(); submitJobToHelix(planningId, planningId, builder); GobblinHelixDistributeJobExecutionLauncher.this.helixMetrics.updateTimeForHelixSubmit(submitStartTime); long waitStartTime = System.currentTimeMillis(); DistributeJobResult rst = waitForJobCompletion(planningId, planningId); GobblinHelixDistributeJobExecutionLauncher.this.helixMetrics.updateTimeForHelixWait(waitStartTime); return rst; } catch (Exception e) { log.error(planningId + " is not able to submit."); return new DistributeJobResult(false); } } }
long submitStart = System.currentTimeMillis(); if (helixMetrics.isPresent()) { helixMetrics.get().submitMeter.mark();
@Test(dependsOnMethods = "testChildContext") public void testContextAwareMeter() { ContextAwareMeter jobRecordsProcessRate = this.context.contextAwareMeter(RECORD_PROCESS_RATE); Assert.assertEquals(this.context.getMeters() .get(jobRecordsProcessRate.getName()), jobRecordsProcessRate.getInnerMetric()); Assert.assertEquals(jobRecordsProcessRate.getContext(), this.context); Assert.assertEquals(jobRecordsProcessRate.getName(), RECORD_PROCESS_RATE); jobRecordsProcessRate.mark(); jobRecordsProcessRate.mark(3); Assert.assertEquals(jobRecordsProcessRate.getCount(), 4l); ContextAwareMeter taskRecordsProcessRate = this.childContext.contextAwareMeter(RECORD_PROCESS_RATE); Assert.assertEquals(this.childContext.getMeters() .get(taskRecordsProcessRate.getName()), taskRecordsProcessRate.getInnerMetric()); Assert.assertEquals(taskRecordsProcessRate.getContext(), this.childContext); Assert.assertEquals(taskRecordsProcessRate.getName(), RECORD_PROCESS_RATE); taskRecordsProcessRate.mark(2); Assert.assertEquals(taskRecordsProcessRate.getCount(), 2l); Assert.assertEquals(jobRecordsProcessRate.getCount(), 6l); taskRecordsProcessRate.mark(5); Assert.assertEquals(taskRecordsProcessRate.getCount(), 7l); Assert.assertEquals(jobRecordsProcessRate.getCount(), 11l); }
ContextAwareMeter meter = metricContext.contextAwareMeter("testMeter"); WeakReference<ContextAwareMeter> meterWeakReference = new WeakReference<ContextAwareMeter>(meter); meter.mark(); ContextAwareHistogram histogram = metricContext.contextAwareHistogram("testHistogram"); WeakReference<ContextAwareHistogram> histogramWeakReference = new WeakReference<ContextAwareHistogram>(histogram);
@Override public void mark(long n) { super.mark(n); if (this.parentMeter.isPresent()) { this.parentMeter.get().mark(n); } }