Package | com.myflashlab.air.extensions.firebase.performance |
Class | public class PerfTrace |
Inheritance | PerfTrace Object |
Method | Defined By | ||
---|---|---|---|
PerfTrace($id:int, $context:ExtensionContext)
don't init this class manually, instead use the Perf.newTrace() method. | PerfTrace | ||
getMetric($metricName:String):Number
Gets the value of the metric with the given name in the current trace. | PerfTrace | ||
incrementMetric($metricName:String, $incrementBy:Number):void
Atomically increments the metric with the given name in this trace by the incrementBy value. | PerfTrace | ||
putMetric($metricName:String, $value:Number):void
Sets the value of the metric with the given name in this trace to the value provided. | PerfTrace | ||
start():void Starts this trace. | PerfTrace | ||
stop():void Stops this trace. | PerfTrace |
PerfTrace | () | Constructor |
public function PerfTrace($id:int, $context:ExtensionContext)
don't init this class manually, instead use the Perf.newTrace()
method.
$id:int | |
$context:ExtensionContext |
getMetric | () | method |
public function getMetric($metricName:String):Number
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.
Parameters
$metricName:String — Name of the metric to get. Requires no leading or trailing whitespace, no leading
underscore '_' character, max length is 100 characters.
|
Number — Value of the metric or 0 if it hasn't yet been set.
|
incrementMetric | () | method |
public function incrementMetric($metricName:String, $incrementBy:Number):void
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.
Parameters
$metricName:String — Name of the metric to be incremented. Requires no leading or trailing whitespace, no
leading underscore [_] character, max length of 100 characters.
| |
$incrementBy:Number — Amount by which the metric has to be incremented.
|
putMetric | () | method |
public function putMetric($metricName:String, $value:Number):void
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.
Parameters
$metricName:String — Name of the metric to set. Requires no leading or trailing whitespace, no leading
underscore '_' character, max length is 100 characters.
| |
$value:Number — The value to which the metric should be set to.
|
start | () | method |
public function start():void
Starts this trace.
stop | () | method |
public function stop():void
Stops this trace.