/** * Execute some code and update the specified counter. This invocation increments the counter by 1 * * @param r * A Runnable or closure with no args and no return values * @param counterName * The name of the counter to update */ default void counted(Runnable r, String counterName) { counted(r, counterName, 1L); }
/** * Execute some code and update the specified event rate metric. This invocation represents a single event. * * @param r * A Runnable to run or a closure with no arguments and no returns * @param meterName * The meter to update */ default void metered(Runnable r, String meterName) { metered(r, meterName, 1L); }
/** * Execute some code and upate the specified counter. This invocation increments the counter by 1 * * @param c * A Callable to execute * @param meterName * The name of the meter to update * * @return The result of processing */ default <V> V counted(Callable<V> c, String meterName) throws Exception { return counted(c, meterName, 1L); }
/** * Execute some code and update the specified event rate metric. This invocation represents a single event * * @param c * a Callable to execute * @param meterName * The meter to update * * @return The result of processing */ default <V> V metered(Callable<V> c, String meterName) throws Exception { return metered(c, meterName, 1L); }
/** * Execute some code and update the specified counter. This invocation increments the counter by 1 * * @param c * A Consumer to execute. aka a closure with one argument and no returned value * @param arg * The argument to the function * @param counterName * The name of the counter to update */ default <T> void counted(Consumer<T> c, T arg, String counterName) { counted(c, arg, counterName, 1L); }
/** * Execute some code and update the specified event rate metric. This invocation represents a single event * * @param c * A Consumer to execute. aka a closure with one argument and no returned value * @param arg * The argument to the function * @param meterName * The meter to update */ default <T> void metered(Consumer<T> c, T arg, String meterName) { metered(c, arg, meterName, 1L); }
/** * Execute some code and update the specified counter. This invocation increments the counter by 1 * * @param f * A Function to execute. aka a closure with one argument and a returned value * @param arg * The argument to the function * @param counterName * The name of the counter to update * * @return The result of processing */ default <T, R> R counted(Function<T, R> f, T arg, String counterName) { return counted(f, arg, counterName, 1L); }
/** * Execute some code and update the specified event rate metric. This invocation represents a single event * * @param f * A Function to execute. aka a closure with one argument and a returned value * @param arg * The argument to the function * @param meterName * The meter to update * * @return The result of processing */ default <T, R> R metered(Function<T, R> f, T arg, String meterName) { return metered(f, arg, meterName, 1L); }
/** * Execute some code and update the specified counter. The invocation increments the counter by 1 * * @param bc * A BiConsumer to execute. aka a closure with two arguments and no returned value * @param arg1 * The first argument * @param arg2 * The second argument * @param counterName * The name of the counter to update */ default <T, U> void counted(BiConsumer<T, U> bc, T arg1, U arg2, String counterName) { counted(bc, arg1, arg2, counterName, 1L); }
/** * Execute some code and update the specified event rate metric. This invocation represents a single event * * @param bc * A BiConsumer to execute. aka a closure with two arguments and no returned value * @param arg1 * The first argument * @param arg2 * the second argument * @param meterName * The meter to update */ default <T, U> void metered(BiConsumer<T, U> bc, T arg1, U arg2, String meterName) { metered(bc, arg1, arg2, meterName, 1L); }
/** * Execute some code and update the specified counter. This invocation increments the counter by 1 * * @param bf * A BiFunction to execute. aka a closure with two arguments and one returned value * @param arg1 * The first argument * @param arg2 * The second argument * @param counterName * The name of the counter to update * * @return The result of processing */ default <T, U, R> R counted(BiFunction<T, U, R> bf, T arg1, U arg2, String counterName) { return counted(bf, arg1, arg2, counterName, 1L); }
/** * Execute some code and update the specified event rate metric. This invocation represents a single event * * @param bf * A BiFunction to execute. aka a closure with two arguments and one returned value * @param arg1 * The first argument * @param arg2 * The second argument * @param meterName * The meter to update */ default <T, U, R> R metered(BiFunction<T, U, R> bf, T arg1, U arg2, String meterName) { return metered(bf, arg1, arg2, meterName, 1L); }