Package | mx.messaging.messages |
Class | public class MessagePerformanceUtils |
Inheritance | MessagePerformanceUtils ![]() |
Metrics are gathered when the following properties on the channel are set to true
:
<record-message-times>
enables capturing of timing information,
<record-message-sizes>
enables capturing of sizing information.
Set these parameters to true
or false
,
where the default value is false
.
You can set them to different values to capture only one type of metrics.
For example, the following channel definition specifies to capture message timing information,
but not message sizing information:
<channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/> <properties> <record-message-times>true</record-message-times> <record-message-sizes>false</record-message-sizes> </properties> </channel-definition>
In your client application, you use the methods and properties of this class to retrieve performance metrics about received messages.
When these metrics are enabled an instance of this class should be created from a response, acknowledgement, or message handler in the form:
var mpiutil:MessagePerformanceUtils = new MessagePerformanceUtils(event.message);
Property | Defined By | ||
---|---|---|---|
clientReceiveTime : Number
[read-only]
The number of milliseconds since the start of the Unix epoch,
January 1, 1970, 00:00:00 GMT, to when the client received response message from the server.
| MessagePerformanceUtils | ||
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
messageSize : int
[read-only]
The size of the original client message, in bytes,
as measured during deserialization by the server endpoint.
| MessagePerformanceUtils | ||
networkRTT : Number
[read-only]
The duration, in milliseconds, from when a client sent a message to the server
until it received a response, excluding the server processing time.
| MessagePerformanceUtils | ||
originatingMessageSentTime : Number
[read-only]
The timestamp, in milliseconds since the start of the Unix epoch on
January 1, 1970, 00:00:00 GMT, to when the client that caused a push message sent its message.
| MessagePerformanceUtils | ||
originatingMessageSize : Number
[read-only]
Size, in bytes, of the message that originally caused this pushed message.
| MessagePerformanceUtils | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
pushedMessageFlag : Boolean
[read-only]
Contains true if the message was pushed to the client
but is not a response to a message that originated on the client.
| MessagePerformanceUtils | ||
pushOneWayTime : Number
[read-only]
Time, in milliseconds, from when the server pushed the message
until the client received it.
| MessagePerformanceUtils | ||
responseMessageSize : int
[read-only]
The size, in bytes, of the response message sent to the client by the server
as measured during serialization at the server endpoint.
| MessagePerformanceUtils | ||
serverAdapterExternalTime : Number
[read-only]
Time, in milliseconds, spent in a module invoked from the adapter associated
with the destination for this message, before either the response to the message
was ready or the message had been prepared to be pushed to the receiving client.
| MessagePerformanceUtils | ||
serverAdapterTime : Number
[read-only]
Processing time, in milliseconds, of the message by the adapter
associated with the destination before either the response to
the message was ready or the message has been prepared to be pushed
to the receiving client.
| MessagePerformanceUtils | ||
serverNonAdapterTime : Number
[read-only]
Server processing time spent outside of the adapter associated with
the destination of this message.
| MessagePerformanceUtils | ||
serverPollDelay : Number
[read-only]
Time, in milliseconds, that this message sat on the server after it was ready
to be pushed to this client but before it was picked up by a poll request.
| MessagePerformanceUtils | ||
serverPrePushTime : Number
[read-only]
Time, in milliseconds, between the server receiving the client message
and the server beginning to push the message out to other clients.
| MessagePerformanceUtils | ||
serverProcessingTime : Number
[read-only]
Time, in milliseconds, between server receiving the client message and
either the time the server responded to the received message or has
the pushed message ready to be sent to a receiving client.
| MessagePerformanceUtils | ||
serverSendTime : Number
[read-only]
The number of milliseconds since the start of the Unix epoch,
January 1, 1970, 00:00:00 GMT, to when the server sent a response message back to the client.
| MessagePerformanceUtils | ||
totalPushTime : Number
[read-only]
Time, in milliseconds, from when the originating client sent a message
and the time that the receiving client received the pushed message.
| MessagePerformanceUtils | ||
totalTime : Number
[read-only]
Time, in milliseconds, between this client sending a message and
receiving a response from the server.
| MessagePerformanceUtils |
Method | Defined By | ||
---|---|---|---|
MessagePerformanceUtils(message:Object)
Constructor.
| MessagePerformanceUtils | ||
![]() |
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 | |
The prettyPrint() method returns a formatted String containing all
non-zero and non-null properties of the class.
| MessagePerformanceUtils | ||
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
Returns the string representation of the specified object.
| Object | |
![]() |
Returns the primitive value of the specified object.
| Object |
clientReceiveTime | property |
clientReceiveTime:Number
[read-only] The number of milliseconds since the start of the Unix epoch, January 1, 1970, 00:00:00 GMT, to when the client received response message from the server.
public function get clientReceiveTime():Number
messageSize | property |
messageSize:int
[read-only] The size of the original client message, in bytes, as measured during deserialization by the server endpoint.
public function get messageSize():int
networkRTT | property |
networkRTT:Number
[read-only] The duration, in milliseconds, from when a client sent a message to the server until it received a response, excluding the server processing time. This value is calculated as totalTime - serverProcessingTime.
In the case of a pushed message using an RTMP channel, this metric is meaningless because client does not initiate the pushed message; the server sends a message to the client whenever a message is available. Therefore, for RTMP pushed message this value is 0, but for RTMP acknowledge messages it contains a valid number.
public function get networkRTT():Number
originatingMessageSentTime | property |
originatingMessageSentTime:Number
[read-only] The timestamp, in milliseconds since the start of the Unix epoch on January 1, 1970, 00:00:00 GMT, to when the client that caused a push message sent its message. Only populated in the case of a pushed message, but not for an acknowledge message.
public function get originatingMessageSentTime():Number
originatingMessageSize | property |
originatingMessageSize:Number
[read-only] Size, in bytes, of the message that originally caused this pushed message. Only populated in the case of a pushed message, but not for an acknowledge message.
public function get originatingMessageSize():Number
pushedMessageFlag | property |
pushedMessageFlag:Boolean
[read-only]
Contains true
if the message was pushed to the client
but is not a response to a message that originated on the client.
For example, when the client polls the server for a message,
pushedMessageFlag
is false
.
When you are using a streaming channel, pushedMessageFlag
is true.
For an acknowledge message, pushedMessageFlag
is false
.
public function get pushedMessageFlag():Boolean
pushOneWayTime | property |
pushOneWayTime:Number
[read-only] Time, in milliseconds, from when the server pushed the message until the client received it. Note that this value is only relevant if the server and receiving client have synchronized clocks. Only populated in the case of a pushed message, but not for an acknowledge message.
public function get pushOneWayTime():Number
responseMessageSize | property |
responseMessageSize:int
[read-only] The size, in bytes, of the response message sent to the client by the server as measured during serialization at the server endpoint.
public function get responseMessageSize():int
serverAdapterExternalTime | property |
serverAdapterExternalTime:Number
[read-only]
Time, in milliseconds, spent in a module invoked from the adapter associated
with the destination for this message, before either the response to the message
was ready or the message had been prepared to be pushed to the receiving client.
This corresponds to the time that the message was processed by the server,
excluding the time it was processed by your custom code, as defined by the value in
the serverAdapterTime
property.
public function get serverAdapterExternalTime():Number
serverAdapterTime | property |
serverAdapterTime:Number
[read-only] Processing time, in milliseconds, of the message by the adapter associated with the destination before either the response to the message was ready or the message has been prepared to be pushed to the receiving client. This corresponds to the time that the message was processed by your code on the server.
public function get serverAdapterTime():Number
serverNonAdapterTime | property |
serverNonAdapterTime:Number
[read-only]
Server processing time spent outside of the adapter associated with
the destination of this message.
Calculated as serverProcessingTime
- serverAdapterTime
.
public function get serverNonAdapterTime():Number
serverPollDelay | property |
serverPollDelay:Number
[read-only] Time, in milliseconds, that this message sat on the server after it was ready to be pushed to this client but before it was picked up by a poll request. For an RTMP channel, this value is always 0.
public function get serverPollDelay():Number
serverPrePushTime | property |
serverPrePushTime:Number
[read-only] Time, in milliseconds, between the server receiving the client message and the server beginning to push the message out to other clients.
public function get serverPrePushTime():Number
serverProcessingTime | property |
serverProcessingTime:Number
[read-only] Time, in milliseconds, between server receiving the client message and either the time the server responded to the received message or has the pushed message ready to be sent to a receiving client. For example, for an acknowledge message, this is the time from when the server receives a message from the producer and sends the acknowledge message back to the producer. For a consumer that uses polling, it is the time between the arrival of the consumer?s polling message and any message returned in response to the poll.
public function get serverProcessingTime():Number
serverSendTime | property |
serverSendTime:Number
[read-only] The number of milliseconds since the start of the Unix epoch, January 1, 1970, 00:00:00 GMT, to when the server sent a response message back to the client.
public function get serverSendTime():Number
totalPushTime | property |
totalPushTime:Number
[read-only] Time, in milliseconds, from when the originating client sent a message and the time that the receiving client received the pushed message. Note that this value is only relevant if the two clients have synchronized clocks. Only populated in the case of a pushed message, but not for an acknowledge message,
public function get totalPushTime():Number
totalTime | property |
totalTime:Number
[read-only] Time, in milliseconds, between this client sending a message and receiving a response from the server. This property contains 0 for an RTMP channel.
public function get totalTime():Number
MessagePerformanceUtils | () | Constructor |
public function MessagePerformanceUtils(message:Object)
Constructor. Creates an MessagePerformanceUtils instance with information from the message received by the client.
Parametersmessage:Object — The message received from the server.
This can be a message pushed from the server, or an acknowledge message received
by the client after the client pushed a message to the server.
|
prettyPrint | () | method |
public function prettyPrint():String
The prettyPrint() method returns a formatted String containing all non-zero and non-null properties of the class.
For example, you can use the Alert control to display the available metrics, as the following example shows:
var mpiutil:MessagePerformanceUtils = new MessagePerformanceUtils(message); Alert.show(mpiutil.prettyPrint(), "MPI Output", Alert.NONMODAL);Returns
String — String containing a summary of all available non-zero and non-null metrics.
|