/** * Measure current tuple throughput and calculate one-, five-, and * fifteen-minute exponentially-weighted moving averages. * * @param <T> * TStream tuple type * @param stream to stream to instrument * @return a {@link TStream} containing the input tuples */ public static <T> TStream<T> rateMeter(TStream<T> stream) { return stream.pipe(new RateMeter<T>()); }
@Test public void metricNullNameRateMeter() throws Exception { Context<Object,Object> ctx = new Context<>(); RateMeter<Object> op = new RateMeter<>(); op.initialize(ctx); assertNull(op.getMetricName()); op.close(); }
@Test public void metricNameRateMeter() throws Exception { Context<Object,Object> ctx = new Context<>(); ctx.addService(MetricRegistry.class, new MetricRegistry()); RateMeter<Object> op = new RateMeter<>(); op.initialize(ctx); assertNotNull(op.getMetricName()); op.close(); }