-
-
Save monkey-codes/8bf33c4d905ae4da45a6a6212b8da550 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| T read() { | |
| namespace.push("read") | |
| def timer = metricRegistry.timer(namespace.name()).time() | |
| try { | |
| T result = delegate.read() | |
| if (result != null) timer.stop() | |
| result | |
| } catch (all) { | |
| metricRegistry.counter("${namespace}.error").inc() | |
| throw all | |
| } finally { | |
| namespace.pop() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment