protected GoTimer getMethodTimer(String methodName, String originService, String originMethod) { return handlerMetrics.getMethodTimer(methodName, originService, originMethod); }
protected void incrementFailureCounter(String methodName, String originService, String originMethod) { handlerMetrics.incrementFailureCounter(methodName, originService, originMethod); }
protected void incrementSuccessCounter(String methodName, String originService, String originMethod) { handlerMetrics.incrementSuccessCounter(methodName, originService, originMethod); }
public void incrementSuccessCounter(String methodName, String originService, String originMethod) { GoCounter counter = getOrCreateCounter(methodName, originService, originMethod); counter.incSuccess(); }
public void incrementFailureCounter(String methodName, String originService, String originMethod) { GoCounter counter = getOrCreateCounter(methodName, originService, originMethod); counter.incFailure(); }
@Before public void setup() throws RpcCallException { handlerDictionary = new MethodHandlerDictionary(); handlerDictionary.put("a", null); ServiceMethodHandlerUnderTest mockHandlerThrowsRpcCallEx = new ServiceMethodHandlerUnderTest(); handlerDictionary.put("jsonRpcWithException", mockHandlerThrowsRpcCallEx); metricRegistry = mock(MetricRegistry.class); when(metricRegistry.counter(anyString())).thenReturn(mock(Counter.class)); when(metricRegistry.timer(anyString())).thenReturn(mock(Timer.class)); handlerMetrics = mock(RpcHandlerMetrics.class); when(handlerMetrics.getMethodTimer(any(), any(), any())).thenReturn(mock(GoTimer.class)); servlet = new JsonHandler(handlerDictionary, metricRegistry, handlerMetrics, new ServiceProperties(), null); }