File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
main/java/org/truffleruby
shared/java/org/truffleruby/shared Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public class RubyLanguage extends TruffleLanguage<RubyContext> {
67
67
@ Override
68
68
public RubyContext createContext (Env env ) {
69
69
// We need to initialize the Metrics class of the language classloader
70
- Metrics .begin ();
70
+ Metrics .initializeOption ();
71
71
72
72
LOGGER .fine ("createContext()" );
73
73
Metrics .printTime ("before-create-context" );
@@ -88,7 +88,7 @@ protected void initializeContext(RubyContext context) throws Exception {
88
88
@ Override
89
89
protected boolean patchContext (RubyContext context , Env newEnv ) {
90
90
// We need to initialize the Metrics class of the language classloader
91
- Metrics .begin ();
91
+ Metrics .initializeOption ();
92
92
93
93
LOGGER .fine ("patchContext()" );
94
94
Metrics .printTime ("before-patch-context" );
Original file line number Diff line number Diff line change @@ -43,19 +43,26 @@ private static void printMemory(boolean isAOT) {
43
43
}
44
44
}
45
45
46
- public static void end (boolean isAOT ) {
47
- printTime ("after-main" );
48
- printMemory (isAOT );
46
+ /**
47
+ * Assigned here so the property is read after processing the --native.D... options. It needs to
48
+ * be called in each classloader using the Metrics class.
49
+ */
50
+ public static void initializeOption () {
51
+ METRICS_TIME = Boolean .getBoolean ("truffleruby.metrics.time" );
49
52
}
50
53
51
- public static void begin () {
52
- // Assigned here so the property is read after processing the --native.D... options
53
- METRICS_TIME = Boolean . getBoolean ( "truffleruby.metrics.time" );
54
+ public static boolean getMetricsTime () {
55
+ return METRICS_TIME ;
56
+ }
54
57
58
+ public static void begin () {
59
+ initializeOption ();
55
60
printTime ("before-main" );
56
61
}
57
62
58
- public static boolean getMetricsTime () {
59
- return METRICS_TIME ;
63
+ public static void end (boolean isAOT ) {
64
+ printTime ("after-main" );
65
+ printMemory (isAOT );
60
66
}
67
+
61
68
}
You can’t perform that action at this time.
0 commit comments