Skip to content
Permalink
Browse files
Expose Hermes Sampling Profiler in default react native templates
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 15ecb60d6deb96fcb7b0ef70faccd10594ededa3
Showing 1 changed file with 8 additions and 2 deletions.
@@ -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;

@@ -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() {

0 comments on commit 15ecb60

Please sign in to comment.