Skip to content

Commit b1b6b9f

Browse files
committed
Fix Metrics in GraalVM
PullRequest: truffleruby/553
2 parents b91aec2 + d673609 commit b1b6b9f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/truffleruby/RubyLanguage.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ public class RubyLanguage extends TruffleLanguage<RubyContext> {
6666

6767
@Override
6868
public RubyContext createContext(Env env) {
69+
// We need to initialize the Metrics class of the language classloader
70+
Metrics.begin();
71+
6972
LOGGER.fine("createContext()");
7073
Metrics.printTime("before-create-context");
7174
// TODO CS 3-Dec-16 need to parse RUBYOPT here if it hasn't been already?
@@ -84,6 +87,9 @@ protected void initializeContext(RubyContext context) throws Exception {
8487

8588
@Override
8689
protected boolean patchContext(RubyContext context, Env newEnv) {
90+
// We need to initialize the Metrics class of the language classloader
91+
Metrics.begin();
92+
8793
LOGGER.fine("patchContext()");
8894
Metrics.printTime("before-patch-context");
8995
boolean patched = context.patchContext(newEnv);

0 commit comments

Comments
 (0)