@ottrelite/core.Ottrelite
new Ottrelite()
Static
Private
wasInstallCalled: boolean
= false
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 | {} | Optional configuration. |
void
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