Trace allows you to set beginning and end of a certain action in your app.
| 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 static final Creator<Trace> | CREATOR | A public static CREATOR field that implements
Parcelable.Creator and generates instances of your Parcelable class from
a Parcel. |
| int |
describeContents()
Describes the kinds of special objects contained in this Parcelable's
marshalled representation.
|
| String | |
| Map<String, String> |
getAttributes()
Returns the map of all the attributes added to this trace.
|
| long |
getLongMetric(String metricName)
Gets the value of the metric with the given name in the current trace.
|
| void |
incrementCounter(String counterName,
long incrementBy)
This method is deprecated. Please use
incrementMetric(String, long) instead.
|
| void |
incrementCounter(String counterName)
This method is deprecated. Please use
incrementMetric(String, long) instead.
|
| void |
incrementMetric(String metricName,
long incrementBy)
Atomically increments the metric with the given name in this trace by the
incrementBy value.
|
| void | |
| void | |
| void | |
| void |
start()
Starts this trace.
|
| void |
stop()
Stops this trace.
|
| void |
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
Describes the kinds of special objects contained in this Parcelable's marshalled representation. Please refer to //developer.android.com/reference/android/os/Parcelable.html
Returns the value of an attribute.
| attribute | name of the attribute to fetch the value for |
|---|
Returns the map of all the attributes added to this trace.
Gets the value of the metric with the given name in the current trace. If a metric with the given name doesn't exist, it is NOT created and a 0 is returned. This method is atomic.
| metricName | Name of the metric to get. Requires no leading or trailing whitespace, no leading underscore '_' character, max length is 32 characters. |
|---|
This method is deprecated.
Please use
incrementMetric(String, long) instead.
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.
| counterName | Name of the counter to be incremented. Requires no leading or trailing whitespace, no leading underscore [_] character, max length of 32 characters. |
|---|---|
| incrementBy | Amount by which the counter has to be incremented. |
This method is deprecated.
Please use
incrementMetric(String, long) instead.
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.
| counterName | Name of the counter to be incremented. Requires no leading or trailing whitespace, no leading underscore '_' character, max length is 32 characters. |
|---|
Atomically increments the metric with the given name in this trace by the incrementBy value. If the metric does not exist, a new one will be created. If the trace has not been started or has already been stopped, returns immediately without taking action.
| metricName | Name of the metric to be incremented. Requires no leading or trailing whitespace, no leading underscore [_] character, max length of 32 characters. |
|---|---|
| incrementBy | Amount by which the metric has to be incremented. |
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.
| attribute | Name of the attribute |
|---|---|
| value | Value of the attribute |
Sets the value of the metric with the given name in this trace to the value provided. If a metric with the given name doesn't exist, a new one will be created. If the trace has not been started or has already been stopped, returns immediately without taking action. This method is atomic.
| metricName | Name of the metric to set. Requires no leading or trailing whitespace, no leading underscore '_' character, max length is 32 characters. |
|---|---|
| value | The value to which the metric should be set to. |
Removes an already added attribute from the Traces. If the trace has been stopped, this method returns without removing the attribute.
| attribute | 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 //developer.android.com/reference/android/os/Parcelable.html
| out | the Parcel in which the object should be written. |
|---|---|
| flags | Additional flags about how the object should be written. |