Copy link to clipboard
Copied
This question was posted in response to the following article: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/profiler/Telemetry.html
Copy link to clipboard
Copied
Here is some useful code from Adobe Scout developer, Mark Shepherd:
-
Here’s an example of using sendSpanMetric() and sendMetric():
public function foo(): void {
....
// record the start time for my task
var startTime: Number = Telemetry.spanMarker;
// do my task
...
// report the task as a telemetry metric
Telemetry.sendSpanMetric("my.task", startTime);
..
// report some other information
Telemetry.sendMetric("number of things", 12345);
Telemetry.sendMetric("state selected", "Oregon");
}
The elapsed time between the call to ’spanMarker’ and the call to ’sendSpanMetric’ will appear in Scout's Top Activities, Activity Sequence, and Summary panels with the label "my.task". The information "number of things: 12345" and "state selected: Oregon" will appear in Scout's Activity Sequence panel.
You can use any label, as long as it doesn’t start with a "."
Here’s an example of using ’connected’. You would do this if the "computeValue()" function is very expensive, and you don’t want to use it unless Scout is actually listening.
if (Telemetry.connected) {
var computedValue: Object = computeValue();
Telemetry.sendMetric("my computed value", computedValue);
}
Scout doesn’t yet support registerCommandHandler() or unregisterCommandHandler(), these are for future use.
Copy link to clipboard
Copied
I'm not able to call the commands. I'm getting a compiler error,
Error 1120: Access of undefined property Telemetry.
Copy link to clipboard
Copied
use:
import flash.profiler.Telemetry
Copy link to clipboard
Copied
I am using flash professional CS5.5 under flash.profiler i am having profile and showRedrawRegions only.
i couldn't able to import like import flash.profiler.Telemetry.