java.lang.Object | |
↳ | com.google.firebase.perf.metrics.Trace |
Trace allows you to set beginning and end of a certain action in your app.
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 |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR | A public static CREATOR field that implements Parcelable.Creator and generates
instances of your Parcelable class from a Parcel. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describes the kinds of special objects contained in this Parcelable's marshalled
representation.
| |||||||||||
Returns the value of an attribute.
| |||||||||||
Returns the map of all the attributes added to this trace.
| |||||||||||
Increments the counter in this trace with the given name by given value.
| |||||||||||
Increments the counter in this trace with the given name by one.
| |||||||||||
Sets a String value for the specified attribute.
| |||||||||||
Removes an already added attribute from the Traces.
| |||||||||||
Starts this trace.
| |||||||||||
Stops this trace.
| |||||||||||
Flatten this object into a Parcel.
|
[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
A public static CREATOR field that implements Parcelable.Creator
and generates
instances of your Parcelable class from a Parcel.
Describes the kinds of special objects contained in this Parcelable's marshalled representation. Please refer to https://developer.android.com/reference/android/os/Parcelable.html
Returns | |
---|---|
int |
always returns 0. |
Returns the value of an attribute.
Parameters | |
---|---|
attribute |
String : name of the attribute to fetch the value for |
Returns | |
---|---|
String |
the value of the attribute if it exists or null otherwise. |
Returns the map of all the attributes added to this trace.
Returns | |
---|---|
Map<String, String> |
map of attributes and its values currently added to this Trace |
Increments the counter in this trace with the given name by given value. If a counter does not already exist, a new one will be created. If the trace has not been started or has already been stopped, returns immediately without taking action.
Parameters | |
---|---|
counterName |
String : Name of the counter to be incremented. Requires no leading or trailing
whitespace, no leading underscore [_] character, max length of 32 characters. |
incrementBy |
long : Amount by which the counter has to be incremented.
|
Increments the counter in this trace with the given name by one. If a counter does not already exist, a new one will be created. If the trace has not been started or has already been stopped, returns immediately without taking action.
Parameters | |
---|---|
counterName |
String : Name of the counter to be incremented. Requires no leading or trailing
whitespace, no leading underscore '_' character, max length is 32 characters.
|
Sets a String value for the specified attribute. Updates the value of the attribute if the
attribute already exists. If the trace has been stopped, this method returns without adding the
attribute. The maximum number of attributes that can be added to a Trace are .MAX_TRACE_CUSTOM_ATTRIBUTES
.
Parameters | |
---|---|
attribute |
String : Name of the attribute |
value |
String : Value of the attribute |
Returns | |
---|---|
void |
true if the attribute was added, false otherwise. |
Removes an already added attribute from the Traces. If the trace has been stopped, this method returns without removing the attribute.
Parameters | |
---|---|
attribute |
String : Name of the attribute to be removed from the running Traces.
|
Starts this trace.
Stops this trace.
Flatten this object into a Parcel. Please refer to https://developer.android.com/reference/android/os/Parcelable.html
Parameters | |
---|---|
out |
Parcel : the Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written.
|