@ottrelite/core.Ottrelite
new Ottrelite()
Static Private enabled: boolean = false
Indicates whether Ottrelite is enabled or not.
Static hybridObject: ReactNativeOttrelite
Static Private wasInstallCalled: boolean = false
Static Protected _listInstalledBackends(): OttreliteBackendInfo[]
Static Protected _setEnabled(enabled): void
| Name | Type |
|---|---|
enabled | boolean |
void
Static Protected assertInstallCalled(): void
Asserts that Ottrelite.install() has been called; throws an error if not.
void
Static beginAsyncEvent(eventName, additionalArgs?): number
Begins tracing a new event using the asynchronous API (allowing multiple events with the same name simultaneously).
| Name | Type | Description |
|---|---|---|
eventName | string | The name of the event to begin |
additionalArgs? | Record<string, string> | Optional map of additional event metadata |
number
Token assigned to this trace entry, required to end this event
Static beginEvent(eventName, additionalArgs?): void
Begins tracing a new event using the synchronous API. Needs to have a matching invocation of endEvent() to close the event.
| Name | Type | Description |
|---|---|---|
eventName | string | The name of the event to begin |
additionalArgs? | Record<string, string> | Optional map of additional event metadata |
void
Static counterEvent(eventName, value): void
Registers a counter event with a given value.
| Name | Type | Description |
|---|---|---|
eventName | string | The name of the event |
value | number | The numerical value of the counter event |
void
Static endAsyncEvent(eventName, token, additionalArgs?): void
Ends tracing a previously started event in a given frame using the asynchronous API.
| Name | Type | Description |
|---|---|---|
eventName | string | The name of the event to begin |
token | number | Token returned by beginAsyncEvent |
additionalArgs? | Record<string, string> | Optional map of additional event metadata |
void
Static endEvent(additionalArgs?): void
Ends tracing a previously started event in a given frame using the synchronous API.
| Name | Type |
|---|---|
additionalArgs? | Record<string, string> |
void
Static Private getJsStackTrace(): StackTraceEntry[]
Static install(backends?, options?): void
Used to register the backends you want to use in your application. You can pass an array of backend classes to this function, and it will initialize them, making all invocations to the core API be passed to the backends that support them.
Not all backends support all API calls; sometimes the support level may depend on e.g. the minimum Android API level targeted by your application (which is the case for the ATrace
backend) - please consult the README.md files of the individual backends for detailed information.
| Name | Type | Default value | Description |
|---|---|---|---|
backends | OttreliteBackend[] | [] | Array of backend classes to register; these classes are pure imports from the individual backend packages. |
options | OttreliteOptions | undefined | Optional configuration. |
void
Static isEnabled(): boolean
Checks whether Ottrelite is enabled.
boolean
true if Ottrelite is enabled, false otherwise.
Static listInstalledBackends(): OttreliteBackendInfo[]
Returns detailed information about the currently-installed backends.
List of details of installed backends
Static Private safelyIterateBackendsList(backends, callback): void
| Name | Type |
|---|---|
backends | OttreliteBackend[] |
callback | (backend: OttreliteBackend) => void |
void
Static setEnabled(enabled): void
Sets the enabled state of Ottrelite.
| Name | Type | Description |
|---|---|---|
enabled | boolean | whether to enable Ottrelite. |
void