Packageflash.profiler
Classpublic final class Telemetry
InheritanceTelemetry Inheritance Object

Language version: ActionScript 3.0
Runtime version: AIR 3.4

The Telemetry class lets an application profile ActionScript code and register handlers for commands



Public Properties
 PropertyDefined by
  connected : Boolean
[static][read-only] Indicates whether Telemetry is connected to a server
Telemetry
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  spanMarker : Number
[static][read-only] Returns a marker for use with Telemetry.sendSpanMetric
Telemetry
Public Methods
 MethodDefined by
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
[static] Register a function that can be called by issuing a command over a socket

Returns true if the registration is successful.

Telemetry
  
sendMetric(metric:String, value:*):void
[static] Requests a custom metric from Telemetry.
Telemetry
  
sendSpanMetric(metric:String, startSpanMarker:Number, value:* = null):void
[static] Requests a custom span metric from Telemetry

Use Telemetry.spanMarker to get a marker at the start of function to be profiled and call Telemetry.sendSpanMetric at the end of function with the marker.

Telemetry
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
[static]
Telemetry
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
connectedproperty
connected:Boolean  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3.4

Indicates whether Telemetry is connected to a server

Implementation
    public static function get connected():Boolean
spanMarkerproperty 
spanMarker:Number  [read-only]

Language version: ActionScript 3.0
Runtime version: AIR 3.4

Returns a marker for use with Telemetry.sendSpanMetric

Implementation
    public static function get spanMarker():Number

See also

Method detail
registerCommandHandler()method
public static function registerCommandHandler(commandName:String, handler:Function):Boolean

Language version: ActionScript 3.0
Runtime version: AIR 3.4

Register a function that can be called by issuing a command over a socket

Returns true if the registration is successful. If registration fails, there is already a handler registered for the command used (or the command name starts with '.', which is reserved for player internal use) Already registered handlers may be unregistered using unregisterCommandHandler before registering another handler.

The handler function's return value is sent as the result of the command (tlm-response.result). The handler function can throw Error, if it wants to send an error response. In this case, Error.message and Error.id are sent as tlm-response.tlm-error.message and tlm-response.tlm-error.code, respectively. (tlm-response.result and tlm-response.tlm-error.data are sent as null)

Parameters
commandName:String — String specifying a unique name (The command over the socket should specify this string as the method name). The guideline is to follow reverse DNS notation, which helps to avoid namespace collisions. Additionally, and names starting with . are reserved for native use.
 
handler:Function — Function to be called when a command is received by Telemetry over the socket with the method name, as specified in functionId argument. The handler should accept only one argument of type Array (as defined by tlm-method.params in Telemetry Protocol), which has to be sent by Telemetry server along with method name.

Returns
Boolean
sendMetric()method 
public static function sendMetric(metric:String, value:*):void

Language version: ActionScript 3.0
Runtime version: AIR 3.4

Requests a custom metric from Telemetry. The metric name and object are sent as per the Telemetry protocol format.

The guideline for custom metric namespaces is to follow reverse DNS notation, which helps to avoid namespace collisions.

Parameters
metric:String — Metric name
 
value:* — Any primitive value/object containing the metric details

Throws
ArgumentError — If metric uses reserved namespaces like flash native namespace (for example, if the metric name starts with '.')
sendSpanMetric()method 
public static function sendSpanMetric(metric:String, startSpanMarker:Number, value:* = null):void

Language version: ActionScript 3.0
Runtime version: AIR 3.4

Requests a custom span metric from Telemetry

Use Telemetry.spanMarker to get a marker at the start of function to be profiled and call Telemetry.sendSpanMetric at the end of function with the marker. Telemetry sends the name, starting marker, and duration of the function plus the optional value as per the Telemetry protocol.

The guideline for custom metric namespaces is to follow reverse DNS notation, which helps to avoid namespace collisions.

Span metrics for durations less than a specified threshold, which could be controlled from the Telemetry Server using Telemetry Protocol, would be ignored by Telemetry (will not be sent to Telemetry Server).

Parameters
metric:String — Metric name
 
startSpanMarker:Number — Start marker.
 
value:* (default = null) — Optional parameter. Any primitive value/object to be sent along with name, marker and duration

Throws
ArgumentError — If metric uses reserved namespaces like flash native namespace (i.e. if metric name starts with '.')

See also

unregisterCommandHandler()method 
public static function unregisterCommandHandler(commandName:String):BooleanParameters
commandName:String

Returns
Boolean