Skip to content

Commit

Permalink
Expose Hermes Sampling Profiler in default react native templates
Browse files Browse the repository at this point in the history
Reviewed By: yinghuitan

Differential Revision: D8063912

fbshipit-source-id: bc894762223c552abcb9151f702476cf333c059c
  • Loading branch information
axe-fb authored and facebook-github-bot committed Oct 10, 2019
1 parent b61583a commit 15ecb60
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package com.facebook.hermes.reactexecutor;

import com.facebook.hermes.instrumentation.HermesSamplingProfiler;
import com.facebook.react.bridge.JavaScriptExecutor;
import com.facebook.react.bridge.JavaScriptExecutorFactory;

Expand All @@ -28,10 +29,15 @@ public JavaScriptExecutor create() {
}

@Override
public void startSamplingProfiler() {}
public void startSamplingProfiler() {
HermesSamplingProfiler.enable();
}

@Override
public void stopSamplingProfiler(String filename) {}
public void stopSamplingProfiler(String filename) {
HermesSamplingProfiler.dumpSampledTraceToFile(filename);
HermesSamplingProfiler.disable();
}

@Override
public String toString() {
Expand Down

0 comments on commit 15ecb60

Please sign in to comment.