Package | flash.profiler |
Class | public final class Telemetry |
Inheritance | Telemetry Object |
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 11.4, AIR 3.4 |
Property | Defined By | ||
---|---|---|---|
connected : Boolean [static] [read-only]
Indicates whether Telemetry is connected to a server
| Telemetry | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
spanMarker : Number [static] [read-only]
Returns a marker for use with Telemetry.sendSpanMetric
| Telemetry |
Method | Defined By | ||
---|---|---|---|
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
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 | ||
[static]
Requests a custom metric from Telemetry. | Telemetry | ||
[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 | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
[static] | Telemetry | ||
Returns the primitive value of the specified object. | Object |
connected | property |
spanMarker | property |
registerCommandHandler | () | method |
public static function registerCommandHandler(commandName:String, handler:Function):Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 11.4, 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.
|
Boolean |
sendMetric | () | method |
public static function sendMetric(metric:String, value:*):void
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 11.4, 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 Versions: | Flash Player 11.4, 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 '.')
|
Related API Elements
unregisterCommandHandler | () | method |
Wed Nov 21 2018, 06:34 AM -08:00