You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of NoopMetricRegistry.NoopTimer's time method which takes a Callable<T> is as follows:
@Override
public <T> T time(Callable<T> event) throws Exception {
return event.call();
}
However the implementation of the method overload which takes a Runnable is:
@Override
public void time(Runnable event) {
// NOP
}
This latter implementation is incorrect as the Runnable represents important business logic. That is, switching implementations (e.g. during testing) to a NoopMetricRegistry actually effects the behaviour of the system!
The method body should be as follows:
@Override
public void time(Runnable event) {
event.run();
}
The text was updated successfully, but these errors were encountered:
The implementation of
NoopMetricRegistry.NoopTimer
'stime
method which takes aCallable<T>
is as follows:However the implementation of the method overload which takes a
Runnable
is:This latter implementation is incorrect as the
Runnable
represents important business logic. That is, switching implementations (e.g. during testing) to aNoopMetricRegistry
actually effects the behaviour of the system!The method body should be as follows:
The text was updated successfully, but these errors were encountered: