Skip to content

Commit

Permalink
Modify logging (#1131)
Browse files Browse the repository at this point in the history
* Adding Statistics

* Adding statistics

* Removing logging if the first request exceedes threshold
  • Loading branch information
guljain committed Mar 18, 2024
1 parent 6698080 commit fcbc51a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ private void updateMinMaxStats(
String maxKey = getMaxKey(statistic.getSymbol());
AtomicLong maxVal = maximums.get(maxKey);
if (maxDurationMs > maxVal.get()) {
if (maxDurationMs > LATENCY_LOGGING_THRESHOLD_MS) {

// Log is avoided if the first request exceedes threshold
if (maxDurationMs > LATENCY_LOGGING_THRESHOLD_MS
&& opsCount.get(statistic.getSymbol()).get() > 0) {
logger.atInfo().log(
"Detected potential high latency for operation %s. latencyMs=%s; previousMaxLatencyMs=%s; operationCount=%s; context=%s",
statistic, maxDurationMs, maxVal.get(), opsCount.get(statistic.getSymbol()), context);
Expand Down

0 comments on commit fcbc51a

Please sign in to comment.