From 01efa2f05df48cac2f1e22742aa911a7c0abdb25 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Thu, 7 Apr 2016 18:38:50 -0700 Subject: Adding getLookupTable API to MonitoredCCBAPI --- src/com/p4square/grow/ccb/MonitoredCCBAPI.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') 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 @@ -42,6 +42,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 { -- cgit v1.2.3