@Test public void testTaskIOMetricGroup() { TaskMetricGroup task = UnregisteredMetricGroups.createUnregisteredTaskMetricGroup(); TaskIOMetricGroup taskIO = task.getIOMetricGroup(); assertNotNull(taskIO.getNumRecordsInCounter()); assertNotNull(taskIO.getNumRecordsOutCounter()); Counter c1 = new SimpleCounter(); c1.inc(32L); Counter c2 = new SimpleCounter(); c2.inc(64L); taskIO.reuseRecordsInputCounter(c1); taskIO.reuseRecordsOutputCounter(c2); assertEquals(32L, taskIO.getNumRecordsInCounter().getCount()); assertEquals(64L, taskIO.getNumRecordsOutCounter().getCount()); taskIO.getNumBytesInLocalCounter().inc(100L); taskIO.getNumBytesInRemoteCounter().inc(150L); taskIO.getNumBytesOutCounter().inc(250L); taskIO.getNumBuffersInLocalCounter().inc(1L); taskIO.getNumBuffersInRemoteCounter().inc(2L); taskIO.getNumBuffersOutCounter().inc(3L); IOMetrics io = taskIO.createSnapshot(); assertEquals(32L, io.getNumRecordsIn()); assertEquals(64L, io.getNumRecordsOut()); assertEquals(100L, io.getNumBytesInLocal()); assertEquals(150L, io.getNumBytesInRemote()); assertEquals(250L, io.getNumBytesOut()); assertEquals(1L, taskIO.getNumBuffersInLocalCounter().getCount()); assertEquals(2L, taskIO.getNumBuffersInRemoteCounter().getCount()); assertEquals(3L, taskIO.getNumBuffersOutCounter().getCount()); }
public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInLocal = counter(MetricNames.IO_NUM_BYTES_IN_LOCAL); this.numBytesInRemote = counter(MetricNames.IO_NUM_BYTES_IN_REMOTE); this.numBytesOutRate = meter(MetricNames.IO_NUM_BYTES_OUT_RATE, new MeterView(numBytesOut, 60)); this.numBytesInRateLocal = meter(MetricNames.IO_NUM_BYTES_IN_LOCAL_RATE, new MeterView(numBytesInLocal, 60)); this.numBytesInRateRemote = meter(MetricNames.IO_NUM_BYTES_IN_REMOTE_RATE, new MeterView(numBytesInRemote, 60)); this.numRecordsIn = counter(MetricNames.IO_NUM_RECORDS_IN, new SumCounter()); this.numRecordsOut = counter(MetricNames.IO_NUM_RECORDS_OUT, new SumCounter()); this.numRecordsInRate = meter(MetricNames.IO_NUM_RECORDS_IN_RATE, new MeterView(numRecordsIn, 60)); this.numRecordsOutRate = meter(MetricNames.IO_NUM_RECORDS_OUT_RATE, new MeterView(numRecordsOut, 60)); this.numBuffersOut = counter(MetricNames.IO_NUM_BUFFERS_OUT); this.numBuffersInLocal = counter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL); this.numBuffersInRemote = counter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE); this.numBuffersOutRate = meter(MetricNames.IO_NUM_BUFFERS_OUT_RATE, new MeterView(numBuffersOut, 60)); this.numBuffersInRateLocal = meter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL_RATE, new MeterView(numBuffersInLocal, 60)); this.numBuffersInRateRemote = meter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE_RATE, new MeterView(numBuffersInRemote, 60)); }
TaskIOMetricGroup extends ProxyMetricGroup<TaskMetricGroup> { public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInLocal = counter(MetricNames.IO_NUM_BYTES_IN_LOCAL); this.numBytesInRemote = counter(MetricNames.IO_NUM_BYTES_IN_REMOTE); this.numBytesOutRate = meter(MetricNames.IO_NUM_BYTES_OUT_RATE, new MeterView(numBytesOut, 60)); this.numBytesInRateLocal = meter(MetricNames.IO_NUM_BYTES_IN_LOCAL_RATE, new MeterView(numBytesInLocal, 60)); this.numBytesInRateRemote = meter(MetricNames.IO_NUM_BYTES_IN_REMOTE_RATE, new MeterView(numBytesInRemote, 60)); this.numRecordsIn = counter(MetricNames.IO_NUM_RECORDS_IN, new SumCounter()); this.numRecordsOut = counter(MetricNames.IO_NUM_RECORDS_OUT, new SumCounter()); this.numRecordsInRate = meter(MetricNames.IO_NUM_RECORDS_IN_RATE, new MeterView(numRecordsIn, 60)); this.numRecordsOutRate = meter(MetricNames.IO_NUM_RECORDS_OUT_RATE, new MeterView(numRecordsOut, 60)); this.numBuffersOut = counter(MetricNames.IO_NUM_BUFFERS_OUT); this.numBuffersInLocal = counter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL); this.numBuffersInRemote = counter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE); this.numBuffersOutRate = meter(MetricNames.IO_NUM_BUFFERS_OUT_RATE, new MeterView(numBuffersOut, 60)); this.numBuffersInRateLocal = meter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL_RATE, new MeterView(numBuffersInLocal, 60)); this.numBuffersInRateRemote = meter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE_RATE, new MeterView(numBuffersInRemote, 60)); } }
TaskIOMetricGroup extends ProxyMetricGroup<TaskMetricGroup> { public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInLocal = counter(MetricNames.IO_NUM_BYTES_IN_LOCAL); this.numBytesInRemote = counter(MetricNames.IO_NUM_BYTES_IN_REMOTE); this.numBytesOutRate = meter(MetricNames.IO_NUM_BYTES_OUT_RATE, new MeterView(numBytesOut, 60)); this.numBytesInRateLocal = meter(MetricNames.IO_NUM_BYTES_IN_LOCAL_RATE, new MeterView(numBytesInLocal, 60)); this.numBytesInRateRemote = meter(MetricNames.IO_NUM_BYTES_IN_REMOTE_RATE, new MeterView(numBytesInRemote, 60)); this.numRecordsIn = counter(MetricNames.IO_NUM_RECORDS_IN, new SumCounter()); this.numRecordsOut = counter(MetricNames.IO_NUM_RECORDS_OUT, new SumCounter()); this.numRecordsInRate = meter(MetricNames.IO_NUM_RECORDS_IN_RATE, new MeterView(numRecordsIn, 60)); this.numRecordsOutRate = meter(MetricNames.IO_NUM_RECORDS_OUT_RATE, new MeterView(numRecordsOut, 60)); this.numBuffersOut = counter(MetricNames.IO_NUM_BUFFERS_OUT); this.numBuffersInLocal = counter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL); this.numBuffersInRemote = counter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE); this.numBuffersOutRate = meter(MetricNames.IO_NUM_BUFFERS_OUT_RATE, new MeterView(numBuffersOut, 60)); this.numBuffersInRateLocal = meter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL_RATE, new MeterView(numBuffersInLocal, 60)); this.numBuffersInRateRemote = meter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE_RATE, new MeterView(numBuffersInRemote, 60)); } TaskIOMetricGroup(TaskMetricGroup parent); }
TaskIOMetricGroup extends ProxyMetricGroup<TaskMetricGroup> { public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInLocal = counter(MetricNames.IO_NUM_BYTES_IN_LOCAL); this.numBytesInRemote = counter(MetricNames.IO_NUM_BYTES_IN_REMOTE); this.numBytesOutRate = meter(MetricNames.IO_NUM_BYTES_OUT_RATE, new MeterView(numBytesOut, 60)); this.numBytesInRateLocal = meter(MetricNames.IO_NUM_BYTES_IN_LOCAL_RATE, new MeterView(numBytesInLocal, 60)); this.numBytesInRateRemote = meter(MetricNames.IO_NUM_BYTES_IN_REMOTE_RATE, new MeterView(numBytesInRemote, 60)); this.numRecordsIn = counter(MetricNames.IO_NUM_RECORDS_IN, new SumCounter()); this.numRecordsOut = counter(MetricNames.IO_NUM_RECORDS_OUT, new SumCounter()); this.numRecordsInRate = meter(MetricNames.IO_NUM_RECORDS_IN_RATE, new MeterView(numRecordsIn, 60)); this.numRecordsOutRate = meter(MetricNames.IO_NUM_RECORDS_OUT_RATE, new MeterView(numRecordsOut, 60)); this.numBuffersOut = counter(MetricNames.IO_NUM_BUFFERS_OUT); this.numBuffersInLocal = counter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL); this.numBuffersInRemote = counter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE); this.numBuffersOutRate = meter(MetricNames.IO_NUM_BUFFERS_OUT_RATE, new MeterView(numBuffersOut, 60)); this.numBuffersInRateLocal = meter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL_RATE, new MeterView(numBuffersInLocal, 60)); this.numBuffersInRateRemote = meter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE_RATE, new MeterView(numBuffersInRemote, 60)); } TaskIOMetricGroup(TaskMetricGroup parent); IOMetrics createSnapshot(); Counter getNumBytesOutCounter(); Counter getNumBytesInLocalCounter(); Counter getNumBytesInRemoteCounter(); Counter getNumRecordsInCounter(); Counter getNumRecordsOutCounter(); Counter getNumBuffersOutCounter(); Counter getNumBuffersInLocalCounter(); Counter getNumBuffersInRemoteCounter(); Meter getNumBytesInLocalRateMeter(); Meter getNumBytesInRemoteRateMeter(); Meter getNumBytesOutRateMeter(); void initializeBufferMetrics(Task task); void reuseRecordsInputCounter(Counter numRecordsInCounter); void reuseRecordsOutputCounter(Counter numRecordsOutCounter); }
TaskIOMetricGroup extends ProxyMetricGroup<TaskMetricGroup> { public TaskIOMetricGroup(TaskMetricGroup parent) { super(parent); this.numBytesOut = counter(MetricNames.IO_NUM_BYTES_OUT); this.numBytesInLocal = counter(MetricNames.IO_NUM_BYTES_IN_LOCAL); this.numBytesInRemote = counter(MetricNames.IO_NUM_BYTES_IN_REMOTE); this.numBytesOutRate = meter(MetricNames.IO_NUM_BYTES_OUT_RATE, new MeterView(numBytesOut, 60)); this.numBytesInRateLocal = meter(MetricNames.IO_NUM_BYTES_IN_LOCAL_RATE, new MeterView(numBytesInLocal, 60)); this.numBytesInRateRemote = meter(MetricNames.IO_NUM_BYTES_IN_REMOTE_RATE, new MeterView(numBytesInRemote, 60)); this.numRecordsIn = counter(MetricNames.IO_NUM_RECORDS_IN, new SumCounter()); this.numRecordsOut = counter(MetricNames.IO_NUM_RECORDS_OUT, new SumCounter()); this.numRecordsInRate = meter(MetricNames.IO_NUM_RECORDS_IN_RATE, new MeterView(numRecordsIn, 60)); this.numRecordsOutRate = meter(MetricNames.IO_NUM_RECORDS_OUT_RATE, new MeterView(numRecordsOut, 60)); this.numBuffersOut = counter(MetricNames.IO_NUM_BUFFERS_OUT); this.numBuffersInLocal = counter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL); this.numBuffersInRemote = counter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE); this.numBuffersOutRate = meter(MetricNames.IO_NUM_BUFFERS_OUT_RATE, new MeterView(numBuffersOut, 60)); this.numBuffersInRateLocal = meter(MetricNames.IO_NUM_BUFFERS_IN_LOCAL_RATE, new MeterView(numBuffersInLocal, 60)); this.numBuffersInRateRemote = meter(MetricNames.IO_NUM_BUFFERS_IN_REMOTE_RATE, new MeterView(numBuffersInRemote, 60)); } TaskIOMetricGroup(TaskMetricGroup parent); IOMetrics createSnapshot(); Counter getNumBytesOutCounter(); Counter getNumBytesInLocalCounter(); Counter getNumBytesInRemoteCounter(); Counter getNumRecordsInCounter(); Counter getNumRecordsOutCounter(); Counter getNumBuffersOutCounter(); Counter getNumBuffersInLocalCounter(); Counter getNumBuffersInRemoteCounter(); Meter getNumBytesInLocalRateMeter(); Meter getNumBytesInRemoteRateMeter(); Meter getNumBytesOutRateMeter(); void initializeBufferMetrics(Task task); void reuseRecordsInputCounter(Counter numRecordsInCounter); void reuseRecordsOutputCounter(Counter numRecordsOutCounter);  }