class PerformanceMonitor implements ServiceWrapper {

    public <T> T invoke(final Callable<T> c) throws Exception {
        final LatencyTracker latencyTracker = new LatencyTracker();
        try {
            T result = requestCounter.invoke(new Callable<T>() {
                    public T call() throws Exception {
                        return latencyTracker.invoke(c);
                    }
                });
            recordSuccess(latencyTracker);
            return result;
        } catch (Exception e) {
            recordFailure(latencyTracker);
            if (WRAP_MSG.equals(e.getMessage())) {
                throw (Exception)e.getCause();
            } else {
                throw e;
            }
        }
    }

    public  PerformanceMonitor();

}