public Snapshot snapshot() {
            final LongAdder totalElapsedNanos = new LongAdder();
            final LongAdder activeCalls = new LongAdder();
            final LongAdder totalCalls = new LongAdder();

            currentCalls.values().forEach(call -> {
                final State state = call.getState();
                totalElapsedNanos.add(state.elapsed);
                totalCalls.add(state.calls);
                if (state.calling) {
                    activeCalls.increment();
                }
            });

            final long lastCalls = this.lastCalls.get();
            final long lastElapsed = this.lastElapsed.get();
            final long calls = totalCalls.longValue();
            final long elapsed = totalElapsedNanos.longValue();
            final long deltaCalls = calls - lastCalls + activeCalls.longValue();
            final long deltaElapsed = elapsed - lastElapsed;
            this.lastCalls.set(calls);
            this.lastElapsed.set(elapsed);

            return new Snapshot(
                    name,
                    deltaCalls,
                    deltaElapsed,
                    calls,
                    elapsed);
        }
Creates a non-static {@link LocalMetrics} for transient use in a class/method.

@param isEnabled If false returns an instance that does nothing apart from call
                 the passed runnables/suppliers.
stroom-util/src/main/java/stroom/util/logging/SimpleMetrics.java