logologo
Docs
API
Docs
API
logologo
React Native Ottrelite

Classes

Class: DevSpanProcessorInterceptor
Class: OttreliteMeterProvider
Class: OttreliteTracerProvider
Class: OttreliteBackendPlatform
Class: OttreliteBackendTracy
Class: Ottrelite

Functions

Function: useTracer
Function: vanillaTracerFactory
Function: withTrace
Function: useComponentRenderTracing
Function: withComponentRenderTracing

Interfaces

Interface: OttreliteBackendInfo

Modules

Module: interop-otel/src
Module: @ottrelite/backend-platform
Module: @ottrelite/backend-wrapper-tracy
Module: @ottrelite/core

Types

Type alias: WithTraceProps
Type alias: OttreliteBackend
Type alias: StackTraceEntry
Type alias: TracingAPI
Abstract Logo

Need React or React Native expertise you can count on?

Let's talkLet's talk
Edit this page on GitHub
Previous PageClass: OttreliteBackendTracy
Next PageFunction: useTracer
Need help with React or React Native projects?
We support teams building scalable apps with React and React Native.
Let's talkLet's talk

#Class: Ottrelite

@ottrelite/core.Ottrelite

#Table of contents

#Constructors

  • constructor

#Properties

  • enabled
  • hybridObject
  • wasInstallCalled

#Methods

  • _listInstalledBackends
  • _setEnabled
  • assertInstallCalled
  • beginAsyncEvent
  • beginEvent
  • counterEvent
  • endAsyncEvent
  • endEvent
  • getJsStackTrace
  • install
  • isEnabled
  • listInstalledBackends
  • safelyIterateBackendsList
  • setEnabled

#Constructors

#constructor

new Ottrelite()

#Properties

#enabled

Static Private enabled: boolean = false

Indicates whether Ottrelite is enabled or not.


#hybridObject

Static hybridObject: ReactNativeOttrelite


#wasInstallCalled

Static Private wasInstallCalled: boolean = false

#Methods

#_listInstalledBackends

Static Protected _listInstalledBackends(): OttreliteBackendInfo[]

#Returns

OttreliteBackendInfo[]


#_setEnabled

Static Protected _setEnabled(enabled): void

#Parameters

NameType
enabledboolean

#Returns

void


#assertInstallCalled

Static Protected assertInstallCalled(): void

Asserts that Ottrelite.install() has been called; throws an error if not.

#Returns

void


#beginAsyncEvent

Static beginAsyncEvent(eventName, additionalArgs?): number

Begins tracing a new event using the asynchronous API (allowing multiple events with the same name simultaneously).

#Parameters

NameTypeDescription
eventNamestringThe name of the event to begin
additionalArgs?Record<string, string>Optional map of additional event metadata

#Returns

number

Token assigned to this trace entry, required to end this event


#beginEvent

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.

#Parameters

NameTypeDescription
eventNamestringThe name of the event to begin
additionalArgs?Record<string, string>Optional map of additional event metadata

#Returns

void


#counterEvent

Static counterEvent(eventName, value): void

Registers a counter event with a given value.

#Parameters

NameTypeDescription
eventNamestringThe name of the event
valuenumberThe numerical value of the counter event

#Returns

void


#endAsyncEvent

Static endAsyncEvent(eventName, token, additionalArgs?): void

Ends tracing a previously started event in a given frame using the asynchronous API.

#Parameters

NameTypeDescription
eventNamestringThe name of the event to begin
tokennumberToken returned by beginAsyncEvent
additionalArgs?Record<string, string>Optional map of additional event metadata

#Returns

void


#endEvent

Static endEvent(additionalArgs?): void

Ends tracing a previously started event in a given frame using the synchronous API.

#Parameters

NameType
additionalArgs?Record<string, string>

#Returns

void


#getJsStackTrace

Static Private getJsStackTrace(): StackTraceEntry[]

#Returns

StackTraceEntry[]


#install

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.

#Parameters

NameTypeDefault valueDescription
backendsOttreliteBackend[][]Array of backend classes to register; these classes are pure imports from the individual backend packages.
optionsOttreliteOptionsundefinedOptional configuration.

#Returns

void


#isEnabled

Static isEnabled(): boolean

Checks whether Ottrelite is enabled.

#Returns

boolean

true if Ottrelite is enabled, false otherwise.


#listInstalledBackends

Static listInstalledBackends(): OttreliteBackendInfo[]

Returns detailed information about the currently-installed backends.

#Returns

OttreliteBackendInfo[]

List of details of installed backends


#safelyIterateBackendsList

Static Private safelyIterateBackendsList(backends, callback): void

#Parameters

NameType
backendsOttreliteBackend[]
callback(backend: OttreliteBackend) => void

#Returns

void


#setEnabled

Static setEnabled(enabled): void

Sets the enabled state of Ottrelite.

#Parameters

NameTypeDescription
enabledbooleanwhether to enable Ottrelite.

#Returns

void