@@ -50,7 +50,7 @@ public static long timestamp() {
5050 public static void traceObjectInit (long startTime , long methodId ) {
5151 long endTime = JVM .counterTime ();
5252 long duration = endTime - startTime ;
53- if (MethodTraceEvent .enabled ( ) && JVM .getEventWriter () != null ) {
53+ if (MethodTraceEvent .shouldCommit ( duration ) && JVM .getEventWriter () != null ) {
5454 MethodTraceEvent .commit (startTime , duration , methodId );
5555 }
5656 }
@@ -66,7 +66,7 @@ public static void timingObjectInit(long startTime, long methodId) {
6666 public static void traceTimingObjectInit (long startTime , long methodId ) {
6767 long endTime = JVM .counterTime ();
6868 long duration = endTime - startTime ;
69- if (MethodTraceEvent .enabled ( ) && JVM .getEventWriter () != null ) {
69+ if (MethodTraceEvent .shouldCommit ( duration ) && JVM .getEventWriter () != null ) {
7070 MethodTraceEvent .commit (startTime , duration , methodId );
7171 }
7272 if (MethodTimingEvent .enabled ()) {
@@ -77,7 +77,7 @@ public static void traceTimingObjectInit(long startTime, long methodId) {
7777 public static void trace (long startTime , long methodId ) {
7878 long endTime = JVM .counterTime ();
7979 long duration = endTime - startTime ;
80- if (MethodTraceEvent .enabled ( )) {
80+ if (MethodTraceEvent .shouldCommit ( duration )) {
8181 MethodTraceEvent .commit (startTime , duration , methodId );
8282 }
8383 }
@@ -96,7 +96,7 @@ public static void traceTiming(long startTime, long methodId) {
9696 if (MethodTimingEvent .enabled ()) {
9797 PlatformTracer .addTiming (methodId , duration );
9898 }
99- if (MethodTraceEvent .enabled ( )) {
99+ if (MethodTraceEvent .shouldCommit ( duration )) {
100100 MethodTraceEvent .commit (startTime , duration , methodId );
101101 }
102102 }
0 commit comments