跳到主要内容
Version: 0.73

Systrace

Systrace is a standard Android marker-based profiling tool (and is installed when you install the Android platform-tools package). Profiled code blocks are surrounded by start/end markers which are then visualized in a colorful chart format. Both the Android SDK and React Native framework provide standard markers that you can visualize.

Example

Systrace allows you to mark JavaScript (JS) events with a tag and an integer value. Capture the non-Timed JS events in EasyProfiler.


Reference

Methods

installReactHook()

React JSX
static installReactHook(useFiber)

setEnabled()

React JSX
static setEnabled(enabled)

isEnabled()

React JSX
static isEnabled()

beginEvent()

React JSX
static beginEvent(profileName?, args?)

beginEvent/endEvent for starting and then ending a profile within the same call stack frame.


endEvent()

React JSX
static endEvent()

beginAsyncEvent()

React JSX
static beginAsyncEvent(profileName?)

beginAsyncEvent/endAsyncEvent for starting and then ending a profile where the end can either occur on another thread or out of the current stack frame, eg await the returned cookie variable should be used as input into the endAsyncEvent call to end the profile.


endAsyncEvent()

React JSX
static endAsyncEvent(profileName?, cookie?)

counterEvent()

React JSX
static counterEvent(profileName?, value?)

Register the value to the profileName on the systrace timeline.