@@ -31,7 +31,7 @@ public class ExceptionProbeManager {
3131 // FIXME: if this becomes a bottleneck, find a way to make it concurrent weak identity hashmap
3232 private final Map <Throwable , ThrowableState > snapshotsByThrowable =
3333 Collections .synchronizedMap (new WeakIdentityHashMap <>());
34- private final long captureIntervalMS ;
34+ private final long captureIntervalS ;
3535 private final Clock clock ;
3636
3737 public ExceptionProbeManager (ClassNameFiltering classNameFiltering , Duration captureInterval ) {
@@ -45,7 +45,7 @@ public ExceptionProbeManager(ClassNameFiltering classNameFiltering, Duration cap
4545 ExceptionProbeManager (
4646 ClassNameFiltering classNameFiltering , Duration captureInterval , Clock clock ) {
4747 this .classNameFiltering = classNameFiltering ;
48- this .captureIntervalMS = captureInterval .toMillis ();
48+ this .captureIntervalS = captureInterval .getSeconds ();
4949 this .clock = clock ;
5050 }
5151
@@ -105,7 +105,7 @@ boolean shouldCaptureException(String fingerprint, Clock clock) {
105105 if (lastCapture == null ) {
106106 return false ;
107107 }
108- return ChronoUnit .MILLIS .between (lastCapture , Instant .now (clock )) >= captureIntervalMS ;
108+ return ChronoUnit .SECONDS .between (lastCapture , Instant .now (clock )) >= captureIntervalS ;
109109 }
110110
111111 public void addSnapshot (Snapshot snapshot ) {
0 commit comments