@Override public Counter counter(int name) { return new SimpleCounter(); }
@Override public Counter counter(String name) { return new SimpleCounter(); }
public MeterView(int timeSpanInSeconds) { this(new SimpleCounter(), timeSpanInSeconds); }
public ChainingOutput( OneInputStreamOperator<T, ?> operator, StreamStatusProvider streamStatusProvider, @Nullable OutputTag<T> outputTag) { this.operator = operator; { Counter tmpNumRecordsIn; try { OperatorIOMetricGroup ioMetricGroup = ((OperatorMetricGroup) operator.getMetricGroup()).getIOMetricGroup(); tmpNumRecordsIn = ioMetricGroup.getNumRecordsInCounter(); } catch (Exception e) { LOG.warn("An exception occurred during the metrics setup.", e); tmpNumRecordsIn = new SimpleCounter(); } numRecordsIn = tmpNumRecordsIn; } this.streamStatusProvider = streamStatusProvider; this.outputTag = outputTag; }
@Test public void testGetCount() { Counter c = new SimpleCounter(); c.inc(5); Meter m = new MeterView(c, 60); assertEquals(5, m.getCount()); }
} catch (Exception e) { LOG.warn("An exception occurred during the metrics setup.", e); numRecordsIn = new SimpleCounter();
@Test public void testMarkEvent() { Counter c = new SimpleCounter(); Meter m = new MeterView(c, 60); assertEquals(0, m.getCount()); m.markEvent(); assertEquals(1, m.getCount()); m.markEvent(2); assertEquals(3, m.getCount()); }
} catch (Exception e) { LOG.warn("An exception occurred during the metrics setup.", e); numRecordsIn = new SimpleCounter();
@Test public void testGetRate() { Counter c = new SimpleCounter(); MeterView m = new MeterView(c, 60);
@Override public Counter counter(String name) { return counter(name, new SimpleCounter()); }
@Override public Counter counter(String name) { return counter(name, new SimpleCounter()); }
@Override public Counter counter(String name) { return counter(name, new SimpleCounter()); }
@Override public Counter counter(String name) { return counter(name, new SimpleCounter()); }
@Override public Counter counter(String name) { return counter(name, new SimpleCounter()); }
/** * Used only for testing purpose. Don't use in production! */ @VisibleForTesting public SumAndCount(String name) { sum = 0; count = new SimpleCounter(); histogram = new SimpleHistogram(); }
/** * Creates a new failover strategy that recovers from failures by restarting only the failed task * of the execution graph. * * @param executionGraph The execution graph to handle. * @param callbackExecutor The executor that executes restart callbacks */ public RestartIndividualStrategy(ExecutionGraph executionGraph, Executor callbackExecutor) { this.executionGraph = checkNotNull(executionGraph); this.callbackExecutor = checkNotNull(callbackExecutor); this.numTaskFailures = new SimpleCounter(); }
/** * Creates a new failover strategy that recovers from failures by restarting only the failed task * of the execution graph. * * @param executionGraph The execution graph to handle. * @param callbackExecutor The executor that executes restart callbacks */ public RestartIndividualStrategy(ExecutionGraph executionGraph, Executor callbackExecutor) { this.executionGraph = checkNotNull(executionGraph); this.callbackExecutor = checkNotNull(callbackExecutor); this.numTaskFailures = new SimpleCounter(); }
/** * Creates a new failover strategy that recovers from failures by restarting only the failed task * of the execution graph. * * @param executionGraph The execution graph to handle. * @param callbackExecutor The executor that executes restart callbacks */ public RestartIndividualStrategy(ExecutionGraph executionGraph, Executor callbackExecutor) { this.executionGraph = checkNotNull(executionGraph); this.callbackExecutor = checkNotNull(callbackExecutor); this.numTaskFailures = new SimpleCounter(); }
/** * Creates a new failover strategy that recovers from failures by restarting only the failed task * of the execution graph. * * @param executionGraph The execution graph to handle. * @param callbackExecutor The executor that executes restart callbacks */ public RestartIndividualStrategy(ExecutionGraph executionGraph, Executor callbackExecutor) { this.executionGraph = checkNotNull(executionGraph); this.callbackExecutor = checkNotNull(callbackExecutor); this.numTaskFailures = new SimpleCounter(); }
public TableServiceMetrics(MetricGroup metricGroup) { this.metricGroup = metricGroup; writeTotalBytesMetrics = metricGroup.counter(WRITE_TOTAL_BYTES_METRIC, new SimpleCounter()); writeBpsMetrics = metricGroup.meter(WRITE_BPS_METRIC, new MeterView(writeTotalBytesMetrics, 10)); readTotalBytesMetrics = metricGroup.counter(READ_TOTAL_BYTES_METRIC, new SimpleCounter()); readBpsMetrics = metricGroup.meter(READ_BPS_METRIC, new MeterView(readTotalBytesMetrics, 10)); }