Skip to content

Commit

Permalink
Avoid 0 duration GC event times
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed Nov 14, 2024
1 parent 1e44427 commit bc53fa6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ private void processGcEvent(GarbageCollectionNotificationInfo info) {
.withTag("action", info.getGcAction())
.withTag("cause", info.getGcCause());
Timer timer = Spectator.globalRegistry().timer(eventId);
timer.record(info.getGcInfo().getDuration(), TimeUnit.MILLISECONDS);
long duration = Math.max(1, info.getGcInfo().getDuration());
timer.record(duration, TimeUnit.MILLISECONDS);

// Update promotion and allocation counters
updateMetrics(info.getGcName(), info.getGcInfo());
Expand Down

0 comments on commit bc53fa6

Please sign in to comment.