java.lang.Object | |
↳ | com.google.firebase.perf.FirebasePerformance |
Firebase Performance API. The API is automatically initialized by FirebaseApp.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FirebasePerformance.HttpMethod | Valid HttpMethods for manual network APIs |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MAX_ATTRIBUTE_KEY_LENGTH | Maximum allowed length of the Key of the Trace attribute |
|||||||||
int | MAX_ATTRIBUTE_VALUE_LENGTH | Maximum allowed length of the Value of the Trace attribute |
|||||||||
int | MAX_TRACE_CUSTOM_ATTRIBUTES | Maximum allowed number of attributes allowed in a trace. | |||||||||
int | MAX_TRACE_NAME_LENGTH | Maximum allowed length of the name of the Trace |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a singleton of FirebasePerformance.
| |||||||||||
Determines whether performance monitoring is enabled or disabled
| |||||||||||
Creates a HttpMetric object for collecting network performance data for one request/response
| |||||||||||
Creates a HttpMetric object for collecting network performance data for one request/response
| |||||||||||
Creates a Trace object with given name.
| |||||||||||
Enables or disables performance monitoring.
| |||||||||||
Creates a Trace object with given name and start the trace.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Maximum allowed length of the Key of the Trace
attribute
Maximum allowed length of the Value of the Trace
attribute
Maximum allowed number of attributes allowed in a trace.
Maximum allowed length of the name of the Trace
Returns a singleton of FirebasePerformance.
Returns | |
---|---|
FirebasePerformance |
the singleton FirebasePerformance object. |
Determines whether performance monitoring is enabled or disabled
Returns | |
---|---|
boolean |
true if performance monitoring is enabled and false if performance monitoring is disabled. This is for dynamic enable/disable state. This does not reflect whether instrumentation is enabled/disabled in Gradle properties. |
Creates a HttpMetric object for collecting network performance data for one request/response
Parameters | |
---|---|
url |
URL : a valid URL object |
httpMethod |
String : One of the values GET, PUT, POST, DELETE, HEAD, PATCH, OPTIONS, TRACE, or
CONNECT |
Returns | |
---|---|
HttpMetric |
the new HttpMetric object. |
Creates a HttpMetric object for collecting network performance data for one request/response
Parameters | |
---|---|
url |
String : a valid url String, cannot be empty |
httpMethod |
String : One of the values GET, PUT, POST, DELETE, HEAD, PATCH, OPTIONS, TRACE, or
CONNECT |
Returns | |
---|---|
HttpMetric |
the new HttpMetric object. |
Creates a Trace object with given name.
Parameters | |
---|---|
traceName |
String : name of the trace, requires no leading or trailing whitespace, no leading
underscore '_' character, max length is .MAX_TRACE_NAME_LENGTH characters. |
Returns | |
---|---|
Trace |
the new Trace object. |
Enables or disables performance monitoring. This setting is persisted and applied on future invocations of your application. By default, performance monitoring is enabled. If you need to change the default (for example, because you want to prompt the user before collecting performance stats), add:
<meta-data android:name=firebase_performance_collection_enabled android:value=false />
to your application’s manifest. Changing the value during runtime will override the manifest
value.
If you want to permanently disable sending performance metrics, add
<meta-data android:name="firebase_performance_collection_deactivated" android:value="true" />
to your application's manifest. Changing the value during runtime will not override the
manifest value.
This is separate from enabling/disabling instrumentation in Gradle properties.
Parameters | |
---|---|
enable |
boolean : Should performance monitoring be enabled
|
Creates a Trace object with given name and start the trace.
Parameters | |
---|---|
traceName |
String : name of the trace. Requires no leading or trailing whitespace, no leading
underscore [_] character, max length of .MAX_TRACE_NAME_LENGTH characters. |
Returns | |
---|---|
Trace |
the new Trace object. |