diff options
Diffstat (limited to 'src/com/p4square/grow/ccb')
-rw-r--r-- | src/com/p4square/grow/ccb/MonitoredCCBAPI.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/p4square/grow/ccb/MonitoredCCBAPI.java b/src/com/p4square/grow/ccb/MonitoredCCBAPI.java index 1463c77..43b6433 100644 --- a/src/com/p4square/grow/ccb/MonitoredCCBAPI.java +++ b/src/com/p4square/grow/ccb/MonitoredCCBAPI.java @@ -43,6 +43,21 @@ public class MonitoredCCBAPI implements CCBAPI { } @Override + public GetLookupTableResponse getLookupTable(final GetLookupTableRequest request) throws IOException { + final Timer.Context timer = mMetricRegistry.timer("CCBAPI.getLookupTable.time").time(); + boolean success = false; + try { + final GetLookupTableResponse resp = mAPI.getLookupTable(request); + success = true; + return resp; + } finally { + timer.stop(); + mMetricRegistry.counter("CCBAPI.getLookupTable.success").inc(success ? 1 : 0); + mMetricRegistry.counter("CCBAPI.getLookupTable.failure").inc(!success ? 1 : 0); + } + } + + @Override public GetIndividualProfilesResponse getIndividualProfiles(GetIndividualProfilesRequest request) throws IOException { final Timer.Context timer = mMetricRegistry.timer("CCBAPI.getIndividualProfiles").time(); |