File tree Expand file tree Collapse file tree
sentry-spring-7/src/main/java/io/sentry/spring7/checkin
sentry-spring-jakarta/src/main/java/io/sentry/spring/jakarta/checkin
sentry-spring/src/main/java/io/sentry/spring/checkin
sentry/src/main/java/io/sentry/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
9191 TracingUtils .startNewTrace (scopes );
9292
9393 @ Nullable SentryId checkInId = null ;
94- final long startTime = System .currentTimeMillis ();
94+ final long startTime = System .nanoTime ();
9595 boolean didError = false ;
9696
9797 try {
@@ -105,7 +105,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
105105 } finally {
106106 final @ NotNull CheckInStatus status = didError ? CheckInStatus .ERROR : CheckInStatus .OK ;
107107 CheckIn checkIn = new CheckIn (checkInId , monitorSlug , status );
108- checkIn .setDuration (DateUtils .millisToSeconds (System .currentTimeMillis () - startTime ));
108+ checkIn .setDuration (DateUtils .nanosToSeconds (System .nanoTime () - startTime ));
109109 scopes .captureCheckIn (checkIn );
110110 }
111111 }
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
9191 TracingUtils .startNewTrace (scopes );
9292
9393 @ Nullable SentryId checkInId = null ;
94- final long startTime = System .currentTimeMillis ();
94+ final long startTime = System .nanoTime ();
9595 boolean didError = false ;
9696
9797 try {
@@ -105,7 +105,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
105105 } finally {
106106 final @ NotNull CheckInStatus status = didError ? CheckInStatus .ERROR : CheckInStatus .OK ;
107107 CheckIn checkIn = new CheckIn (checkInId , monitorSlug , status );
108- checkIn .setDuration (DateUtils .millisToSeconds (System .currentTimeMillis () - startTime ));
108+ checkIn .setDuration (DateUtils .nanosToSeconds (System .nanoTime () - startTime ));
109109 scopes .captureCheckIn (checkIn );
110110 }
111111 }
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
9494 TracingUtils .startNewTrace (scopes );
9595
9696 @ Nullable SentryId checkInId = null ;
97- final long startTime = System .currentTimeMillis ();
97+ final long startTime = System .nanoTime ();
9898 boolean didError = false ;
9999
100100 try {
@@ -108,7 +108,7 @@ public Object invoke(final @NotNull MethodInvocation invocation) throws Throwabl
108108 } finally {
109109 final @ NotNull CheckInStatus status = didError ? CheckInStatus .ERROR : CheckInStatus .OK ;
110110 CheckIn checkIn = new CheckIn (checkInId , monitorSlug , status );
111- checkIn .setDuration (DateUtils .millisToSeconds (System .currentTimeMillis () - startTime ));
111+ checkIn .setDuration (DateUtils .nanosToSeconds (System .nanoTime () - startTime ));
112112 scopes .captureCheckIn (checkIn );
113113 }
114114 }
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public static <U> U withCheckIn(
3737 try (final @ NotNull ISentryLifecycleToken ignored =
3838 Sentry .forkedScopes ("CheckInUtils" ).makeCurrent ()) {
3939 final @ NotNull IScopes scopes = Sentry .getCurrentScopes ();
40- final long startTime = System .currentTimeMillis ();
40+ final long startTime = System .nanoTime ();
4141 boolean didError = false ;
4242
4343 TracingUtils .startNewTrace (scopes );
@@ -61,7 +61,7 @@ public static <U> U withCheckIn(
6161 if (environment != null ) {
6262 checkIn .setEnvironment (environment );
6363 }
64- checkIn .setDuration (DateUtils .millisToSeconds (System .currentTimeMillis () - startTime ));
64+ checkIn .setDuration (DateUtils .nanosToSeconds (System .nanoTime () - startTime ));
6565 scopes .captureCheckIn (checkIn );
6666 }
6767 }
You can’t perform that action at this time.
0 commit comments