Packagecom.myflashlab.air.extensions.firebase.performance
Classpublic class PerfTrace
InheritancePerfTrace Inheritance Object

Trace allows you to set beginning and end of a certain action in your app.



Public Methods
 MethodDefined 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
Constructor Detail
PerfTrace()Constructor
public function PerfTrace($id:int, $context:ExtensionContext)

don't init this class manually, instead use the Perf.newTrace() method.

Parameters
$id:int
 
$context:ExtensionContext
Method Detail
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.

Returns
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.