public void addRequestResponseStats(long bytesSent, long numRequests, long bytesReceived, boolean isError, long sendRequestMs, long responseLatencyMs) { _requestsSent.inc(numRequests); _bytesSent.inc(bytesSent); _bytesReceived.inc(bytesReceived); if (isError) { _errors.inc(); } _sendRequestMsHistogram.update(sendRequestMs); _responseLatencyMsHistogram.update(responseLatencyMs); }
public void addServingStats(long requestSize, long responseSize, long numRequests, boolean error, long processingLatencyMs, long sendResponseLatencyMs) { _requestsReceived.inc(numRequests); _bytesReceived.inc(requestSize); _bytesSent.inc(responseSize); if (error) { _errors.inc(); } _sendResponseMsHistogram.update(sendResponseLatencyMs); _processingLatencyMsHistogram.update(processingLatencyMs); }
/** Add a count object to this batcher */ public void add( Count count ) throws CounterProcessingUnavailableException { invocationCounter.inc(); final TimerContext context = addTimer.time(); if ( batchSize == 1 ) { getBatch().addSerial( count ); } else { getBatch().add( count ); } context.stop(); }
/** * Increment the counter by one. */ public void inc() { inc(1); }
@Override public void onFailedCheck() { failedCheckCounter.inc(); } }
@Override public void uncaughtException(Thread t, Throwable e) { counter.inc(); LOGGER.error("Uncaught exception on thread {}", t, e); } }
public void addPoints(List<String> metricStrings) { pointsReceived.inc(metricStrings.size()); synchronized (pointsMutex) { this.points.addAll(metricStrings); } }
@Override public void reject(@NotNull String line, @Nullable String message) { blockedCounter.inc(); rejectedCounter.inc(); blockedItemsLogger.warning(line); if (message != null && blockedItemsLimiter != null && blockedItemsLimiter.tryAcquire()) { logger.info("[" + handle + "] blocked input: [" + message + "]"); } }
@Override public void reject(@Nullable T item, @Nullable String message) { blockedCounter.inc(); rejectedCounter.inc(); if (item != null) { blockedItemsLogger.warning(serializer.apply(item)); } if (message != null && blockedItemsLimiter != null && blockedItemsLimiter.tryAcquire()) { logger.info("[" + handle + "] blocked input: [" + message + "]"); } }
public QueryEngineDirectory(DataTree tree, String dir) { super(tree); this.dir = dir; currentlyOpenEngines.inc(); engineCreations.mark(); //Metric for total trees/engines initialized }
@Override public void add(T t) { addCounter.inc(); try { queueLock.lock(); backingQueue.add(t); } finally { queueLock.unlock(); } }
@Override public T peek() { peekCounter.inc(); T t; try { queueLock.lock(); t = backingQueue.peek(); } finally { queueLock.unlock(); } return t; }
public void queueQuery(MeshQueryMaster querySource, KVPairs kv, HttpRequest request, ChannelHandlerContext ctx) throws Exception { QueryRequest queryRequest = new QueryRequest(querySource, kv, request, ctx); // throws exception when queue is full - callers should handle appropriately blockingQueue.add(queryRequest); queueCount.inc(); }
@Override public void executeAsync() { makeDataRequests(targetReplicas.subList(0, targetReplicas.size() > 1 ? 2 : 1)); if (targetReplicas.size() > 2) makeDigestRequests(targetReplicas.subList(2, targetReplicas.size())); cfs.metric.speculativeRetries.inc(); } }
@Override public void processGauge(MetricName name, Gauge<?> gauge, FlushProcessorContext context) throws Exception { @SuppressWarnings("unchecked") ChangeableGauge<Double> changeableGauge = (ChangeableGauge<Double>) gauge; Double value = changeableGauge.value(); if (value == null || value.isInfinite() || value.isNaN()) return; context.report(value); sentCounter.inc(); } }
private static boolean executeAndTimeInsert(PreparedStatement preparedStatement) throws SQLException { TimerContext timerContext = insertTimer.time(); try { return preparedStatement.execute(); } catch (SQLException e) { errorCounter.inc(); throw e; } finally { timerContext.stop(); } }
private boolean close(OutputWrapper outputWrapper) { synchronized (this) { outputWrapper.close(); openOutputs.remove(outputWrapper.getRawTarget()); openOutputQueue.remove(outputWrapper.getRawTarget()); closes.inc(); return true; } }
/** * Fail a host. For any tasks with replicas on that host, move these replicas elsewhere. For any tasks with live copies on the host, * promote a replica, then make a new replica somewhere else. */ private void markHostDead(String failedHostUuid) { if (failedHostUuid == null || !checkHostStatesForFailure(failedHostUuid)) { return; } spawn.markHostStateDead(failedHostUuid); hostFailState.removeHost(failedHostUuid); failHostCount.inc(); }