package com.ericfeminella.rpc.instrumentation
{
import flash.events.Event;
/**
*
* <code>RPCDiagnosticsEvent</code> provides an <code>Event</code>
* which contains information specific to an <code>RPCDiagnostics</code>
* instance.
*
* @see RPCDiagnostics
*
*/
public class RPCDiagnosticsEvent extends Event
{
/**
*
* Defines the <code>Event.type</code> which this event is
* associated.
*
*/
public static const EXECUTION_COMPLETE:String = "executionComplete";
/**
*
* @private
*
* Defines the <code>operationName</code> which this invocation
* is associated with.
*
*/
private var _operationName:String;
/**
*
* @private
*
* The amount of time the operation took to execute from the
* client to the server and back to the client.
*
*/
private var _duration:int;
/**
*
* <code>RPCDiagnosticsEvent</code> constructor requires the specific
* <code>operationName</code> and <code>duration</code> resulting from
* an <code>RPCDiagnostics</code> instance.
*
* @param The name of the operation which is being monitored.
* @param Amount of time the operation took to completed.
*
*/
public function RPCDiagnosticsEvent(operationName:String, duration:int)
{
super( EXECUTION_COMPLETE, bubbles, cancelable );
_operationName = operationName;
_duration = duration;
}
/**
*
* Defines the <code>operationName</code> which this invocation
* is associated with.
*
* @return The name of the operation which is being monitored
*
*/
public function get operationName() : String
{
return _operationName;
}
/**
*
* The amount of time the operation took to execute from the
* client to the server and back to the client.
*
* @return Amount of time the operation took to completed.
*
*/
public function get duration() : int
{
return _duration;
}
}
}