public void UpdateNumMsgsReceived(IMessage <T> message) { if (message != null) { _numMsgsReceived.Increment(); _numBytesReceived.Add(message.Data.Length); } }
public void UpdateCumulativeStats(IProducerStats stats) { if (stats == null) { return; } _numMsgsSent.Add(stats.NumMsgsSent); _numBytesSent.Add(stats.NumBytesSent); _numSendFailed.Add(stats.NumSendFailed); _numAcksReceived.Add(stats.NumAcksReceived); _totalMsgsSent.Add(stats.NumMsgsSent); _totalBytesSent.Add(stats.NumBytesSent); _totalSendFailed.Add(stats.NumSendFailed); _totalAcksReceived.Add(stats.NumAcksReceived); }
/// <inheritdoc /> public void Record(long duration, TimeUnit unit, string userValue = null) { var nanos = unit.ToNanoseconds(duration); if (nanos < 0) { return; } _histogram.Update(nanos, userValue); _meter.Mark(userValue); _totalRecordedTime.Add(nanos); }
private void StatsAction() { try { long now = DateTime.Now.Millisecond; var elapsed = (now - OldTime) / 1e9; _oldTime = now; var currentNumMsgsReceived = _numMsgsReceived.GetAndReset(); var currentNumBytesReceived = _numBytesReceived.GetAndReset(); var currentNumReceiveFailed = _numReceiveFailed.GetAndReset(); var currentNumBatchReceiveFailed = _numBatchReceiveFailed.GetAndReset(); var currentNumAcksSent = _numAcksSent.GetAndReset(); var currentNumAcksFailed = _numAcksFailed.GetAndReset(); _totalMsgsReceived.Add(currentNumMsgsReceived); _totalBytesReceived.Add(currentNumBytesReceived); _totalReceiveFailed.Add(currentNumReceiveFailed); _totalBatchReceiveFailed.Add(currentNumBatchReceiveFailed); _totalAcksSent.Add(currentNumAcksSent); _totalAcksFailed.Add(currentNumAcksFailed); RateMsgsReceived = currentNumMsgsReceived / elapsed; RateBytesReceived = currentNumBytesReceived / elapsed; if ((currentNumMsgsReceived | currentNumBytesReceived | currentNumReceiveFailed | currentNumAcksSent | currentNumAcksFailed) != 0) { _log.Info($"[{_topic}] [{_subscription}] [{_name}] Consume throughput received: {(RateMsgsReceived).ToString(ThroughputFormat)} msgs/s --- {(RateBytesReceived * 8 / 1024 / 1024).ToString(ThroughputFormat)} Mbit/s --- Ack sent rate: {(currentNumAcksSent / elapsed).ToString(ThroughputFormat)} ack/s --- Failed messages: {currentNumReceiveFailed} --- batch messages: {currentNumBatchReceiveFailed} ---Failed acks: {currentNumAcksFailed}"); } } catch (Exception e) { _log.Error($"[{_topic}] [{_name}] [{_subscription}]: {e.Message}"); } finally { // schedule the next stat info _statTimeout = _system.Scheduler.Advanced.ScheduleOnceCancelable(TimeSpan.FromSeconds(_statsIntervalSeconds), StatsAction); } }
public void UpdateCumulativeStats(IConsumerStats stats) { if (stats == null) { return; } _numMsgsReceived.Add(stats.NumMsgsReceived); _numBytesReceived.Add(stats.NumBytesReceived); _numReceiveFailed.Add(stats.NumReceiveFailed); _numBatchReceiveFailed.Add(stats.NumBatchReceiveFailed); _numAcksSent.Add(stats.NumAcksSent); _numAcksFailed.Add(stats.NumAcksFailed); _totalMsgsReceived.Add(stats.TotalMsgsReceived); _totalBytesReceived.Add(stats.TotalBytesReceived); _totalReceiveFailed.Add(stats.TotalReceivedFailed); _totalBatchReceiveFailed.Add(stats.TotaBatchReceivedFailed); _totalAcksSent.Add(stats.TotalAcksSent); _totalAcksFailed.Add(stats.TotalAcksFailed); }
/// <inheritdoc /> public virtual void Mark(long count) { _uncounted.Add(count); }
public void Can_add_value() { _num.Add(7L); _num.GetValue().Should().Be(7L); }
protected override void addToTotalCount(long value) { totalCount.Add(value); }
/// <inheritdoc /> public void Decrement(long value) { _counter.Add(-value); }
public void IncrementSendFailed(long numMsgs) { _numSendFailed.Add(numMsgs); }
public void UpdateNumMsgsSent(long numMsgs, long totalMsgsSize) { _numMsgsSent.Add(numMsgs); _numBytesSent.Add(totalMsgsSize); }
public void IncrementNumAcksSent(long numAcks) { _numAcksSent.Add(numAcks); }