@Override public void incrementProcessedWithError() { processedWithError.mark(); }
@Override public void incrementThrownAway() { thrownAway.mark(); }
@Override public void incrementProcessed() { processed.mark(); }
@Override public void incrementUnparseable() { unparseable.mark(); }
@Override public void markEvent(long n) { meter.mark(n); }
@Override public void filter(ContainerRequestContext containerRequestContext, ContainerResponseContext containerResponseContext) throws IOException { webRequestMeter.mark(); } }
@Override public void markEvent() { meter.mark(); }
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { webRequestMeter.mark(); HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; HttpServletResponse httpResponse = (HttpServletResponse) servletResponse; if ((httpRequest.getPathInfo()).equals("/index.html")) { mainPageRequestMeter.mark(); httpResponse.addHeader("Cache-Control", "no-cache"); } filterChain.doFilter(servletRequest, servletResponse); }
@Override public void executeTask(Map<String, List<String>> params, String body, PrintWriter output) throws Exception { meter.mark(); underlying.executeTask(params, body, output); } }
@POST @Path("/{func}") public String post(@PathParam("func") String func, String args, @Context HttpServletRequest request) throws Exception { meterHttpRequests.mark(); return responseDuration.time(() -> drpc.executeBlocking(func, args)); }
@GET @Path("/{func}/{args}") public String get(@PathParam("func") String func, @PathParam("args") String args, @Context HttpServletRequest request) throws Exception { meterHttpRequests.mark(); return responseDuration.time(() -> drpc.executeBlocking(func, args)); }
@GET @Path("/{func}") public String get(@PathParam("func") String func, @Context HttpServletRequest request) throws Exception { meterHttpRequests.mark(); return responseDuration.time(() -> drpc.executeBlocking(func, "")); } }
/** * Invoke when lost leadership. */ public void notLeaderCallback() { numLostLeader.mark(); tc.clear(); }
private HBMessage sendPulse(HBPulse pulse) { String id = pulse.get_id(); byte[] details = pulse.get_details(); LOG.debug("Saving Pulse for id [ {} ] data [ {} ].", id, details); meterSendPulseCount.mark(); meterTotalReceivedSize.mark(details.length); histogramHeartbeatSize.update(details.length); heartbeats.put(id, details); return new HBMessage(HBServerMessageType.SEND_PULSE_RESPONSE, null); }
@Override public void cleanUp() throws IOException { try (Timer.Context t = cleanupDuration.time()) { containerMemoryTracker.remove(_port); cleanUpForRestart(); } catch (IOException e) { //This may or may not be reported depending on when process exits numCleanupExceptions.mark(); throw e; } }
public void failRequest(String id, DRPCExecutionException e) throws AuthorizationException { meterFailRequestCalls.mark(); LOG.debug("Got a fail {}", id); OutstandingRequest req = _requests.get(id); if (req != null) { checkAuthorization("failRequest", req.getFunction()); if (e == null) { e = DEFAULT_FAILED; } req.fail(e); } }
@Override public void executeTask(Map<String, List<String>> params, String body, PrintWriter output) throws Exception { try { underlying.executeTask(params, body, output); } catch (Exception e) { if (exceptionMeter != null && isReallyAssignableFrom(e)) { exceptionMeter.mark(); } else { throw e; } } } }
@Override public void killTopology(String name) throws NotAliveException, AuthorizationException, TException { killTopologyCalls.mark(); killTopologyWithOpts(name, new KillOptions()); }
public void returnResult(String id, String result) throws AuthorizationException { meterResultCalls.mark(); LOG.debug("Got a result {} {}", id, result); OutstandingRequest req = _requests.get(id); if (req != null) { checkAuthorization("result", req.getFunction()); req.returnResult(result); } }
@Override public boolean isTopologyNameAllowed(String name) throws AuthorizationException, TException { isTopologyNameAllowedCalls.mark(); try { checkAuthorization(name, null, "getClusterInfo"); validateTopologyName(name); assertTopoActive(name, false); return true; } catch (InvalidTopologyException | AlreadyAliveException e) { return false; } }