public static void clientRefreshMetaInfoCountInc(String subject) { Metrics.counter("clientRefreshMetaInfoCount", SUBJECT_ARRAY, new String[]{subject}).inc(); }
public static void sendMessageTaskInvokeFailCountInc() { Metrics.counter("sendMessageTaskInvokeFailCount").inc(); }
private static void countInc(String name, String[] tags, String[] values, long num) { Metrics.counter(name, tags, values).inc(num); }
public static void scheduleDispatch() { Metrics.counter("scheduleDispatch", EMPTY, EMPTY).inc(); }
public static void brokerDisconnectedCountInc(String groupName) { Metrics.counter("brokerDisconnectedCount", new String[]{"groupName"}, new String[]{groupName}).inc(); }
public static void initSendMessageTasksCountInc() { Metrics.counter("initSendMessageTasksCount").inc(); }
public static void noSendMsgCountInc(String jdbcUrl, int n) { Metrics.counter("noSendMsgCount", new String[]{"jdbcUrl"}, new String[]{jdbcUrl}).inc(n); }
private void pause(String log, long timeMillis) { final String subject = pushConsumer.subject(); final String group = pushConsumer.group(); this.pauseCounter.inc(); LOGGER.debug(logType, "pull pause {} ms, {}. subject={}, group={}", timeMillis, log, subject, group); try { Thread.sleep(timeMillis); } catch (Exception e) { LOGGER.info("PullEntry pause exception. log={}", log, e); } }
private void resend() { resendCount.inc(); traceSpan = null; traceScope = null; state.set(INIT); TraceUtil.recordEvent("retry", tracer); doSend(); }
private HashMap<String, Object> deserializeMapWrapper(String subject, String messageId, ByteBuf body) { try { return deserializeMap(body); } catch (Exception e) { LOGGER.error("deserialize message failed subject:{} messageId: {}", subject, messageId); Metrics.counter("qmq_pull_deserialize_fail_count", SUBJECT_ARRAY, new String[]{subject}).inc(); HashMap<String, Object> result = new HashMap<>(); result.put(BaseMessage.keys.qmq_corruptData.name(), "true"); result.put(BaseMessage.keys.qmq_createTime.name(), new Date().getTime()); return result; } }
public void requestWrapper(MetaInfoRequestParam param) { try { Metrics.counter("qmq_pull_metainfo_request_count", SUBJECT_GROUP_ARRAY, new String[]{param.subject, param.group}).inc(); request(param); } catch (Exception e) { LOGGER.debug("request meta info exception. {} {} {}", param.clientType.name(), param.subject, param.group, e); Metrics.counter("qmq_pull_metainfo_request_fail", SUBJECT_GROUP_ARRAY, new String[]{param.subject, param.group}).inc(); } }
@Override public void fail(Exception ex) { if (ackSendFailLogLimit.tryAcquire()) { LOGGER.warn("send ack fail, will retry next", ex); } LOGGER.debug("AckSendRet fail [{}, {}]", sendEntry.getPullOffsetBegin(), sendEntry.getPullOffsetLast()); sendFailCount.inc(); inSending.set(false); } });
@Override public void send() { sendCount.inc(); attachTraceData(); doSend(); }
private void onFailed() { TraceUtil.recordEvent("send_failed", tracer); sendFailCount.inc(); if (sendStateListener == null) return; sendStateListener.onFailed(base); }
private void markFailed(BrokerGroupInfo group) { pullFailCounter.inc(); group.markFailed(); loadBalance.timeout(group); }
private void onSuccess() { sendOkCount.inc(); sendOkQps.mark(); if (sendStateListener == null) return; sendStateListener.onSuccess(base); }
void sendBackAndCompleteNack(final int nextRetryCount, final BaseMessage message, final AckEntry ackEntry) { final String sendSubject = nextRetryCount > message.getMaxRetryNum() ? deadRetrySubject : retrySubject; if (deadRetrySubject.equals(sendSubject)) { deadQueueCount.inc(); LOGGER.warn("process message retry num {} >= {}, and dead retry. subject={}, group={}, msgId={}", nextRetryCount - 1, message.getMaxRetryNum(), subject, group, message.getMessageId()); } message.setSubject(sendSubject); sendMessageBack.sendBackAndCompleteNack(nextRetryCount, message, ackEntry); }
private static void monitorMessageCount(final PullParam pullParam, final PullResult pullResult) { try { Metrics.counter("qmq_pull_message_count", new String[]{"subject", "group", "broker"}, new String[]{pullParam.getSubject(), pullParam.getGroup(), pullParam.getBrokerGroup().getGroupName()}) .inc(pullResult.getMessages().size()); } catch (Exception e) { LOGGER.error("AbstractPullEntry monitor exception", e); } }
private boolean preparePull() { pullRunCounter.inc(); if (!pushConsumer.cleanLocalBuffer()) { pause("wait consumer", PAUSETIME_OF_CLEAN_LAST_MESSAGE); return false; } if (!pullStrategy.needPull()) { pause("wait consumer", PAUSETIME_OF_NOMESSAGE); return false; } return true; }
private void doSendNack(final int nextRetryCount, final BaseMessage message) { while (true) { try { ackSendQueue.sendBackAndCompleteNack(nextRetryCount, message, this); return; } catch (Exception e) { LOGGER.warn("nack exception. subject={}, group={}", ackSendQueue.getSubject(), ackSendQueue.getGroup(), e); Metrics.counter("qmq_pull_sendNack_error", SUBJECT_GROUP_ARRAY, new String[]{message.getSubject(), ackSendQueue.getGroup()}).inc(); } } }