mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Expose Hermes Sampling Profiler in default react native templates
Reviewed By: yinghuitan Differential Revision: D8063912 fbshipit-source-id: bc894762223c552abcb9151f702476cf333c059c
This commit is contained in:
committed by
Facebook Github Bot
parent
b61583a780
commit
15ecb60d6d
+8
-2
@@ -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 class HermesExecutorFactory implements JavaScriptExecutorFactory {
|
||||
}
|
||||
|
||||
@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() {
|
||||
|
||||
Reference in New Issue
Block a user