Measuring message processing performance

Firstly, LiveCycle Data Services 2.6 Developer Guide is amazing. Everything is explained clearly. LCDS team rocks 🙂

LiveCycle Data Services developer guide:

I was going through the document and found a topic which explains how adding a few tags in the services-config.xml file will get lots and lots of metrics regarding processing time of a message. Information regarding message size, server processing time, and network travel time is available to the clients. You can also get information on the server logs. This works for all types of channels. That means you can also measure performance for a Remoting call also. This is available in both BlazeDS and LCDS 🙂

You can find detailed explanation on this mechanism at this URL:

Few metrics I liked the most are message size, server adapter time, server processing time, server send time and total time. There are lot more, you can find a table explaining the metrics in the URL included above.

We will have a look at main steps required to enable gathering metrics with a Remoting sample.

On the server

First you need to tell your channel to send the metrics to the clients. For this you need to add 2 tags in services-config.xml under the channel tag as shown below. Here I am adding it for an AMF channel. I am using this channel for my Remoting Service destinations. In the code snippet below tags in bold are the ones to be added. You have to add the tags for the channel you want the metrics for.


<channel-definition id=”my-amf” class=”mx.messaging.channels.AMFChannel”>

<endpoint url=”http://{}:{server.port}/{context.root}/messagebroker/amf” class=”flex.messaging.endpoints.AMFEndpoint”/>









On the client

MessagePerformanceUtils class will help you to parse the metrics from the message returned from the server. All you need to do is to pass the message to the MessagePerformanceUtils class constructor in the result handler. Once this is done, you will use MessagePerformanceUtils instance to retrieve the metrics.

Please download sample from this URL:

In the function below which is the result handler in the sample code attached, you can see we are passing the message object returned by the server to the MessagePerformanceUtils class. prettyPrint() method of this class returns a formatted string of metrics. You can find more details on MessagePerformanceUtils class at this URL

private function handleServerResponse(event:ResultEvent):void{

remoteObject.removeEventListener(ResultEvent.RESULT, handleServerResponse);

remoteObject.removeEventListener(FaultEvent.FAULT,               handleServerFault);

//processing the result

var performanceDetails:MessagePerformanceUtils =

new MessagePerformanceUtils(event.message);

txtOutput.text = performanceDetails.prettyPrint();


Creating Remoting destination and Java class

Please find details on how to invoke Java methods from Flex using Remoting at this URL

All you need to do is to create a Remoting destination with TestingOnly as id and set the source to a Java class with method below.

public String echo(String echoString){return echoString;}

That’s all you need to do 🙂 now you have all metrics required to measure message processing performance.


4 Responses to Measuring message processing performance

  1. Esteban says:


    i’m trying to measure message processing performance using blazeds, i create more than 3 different flex
    application, but always got the same error:

    Error: Message is missing MPI headers. Verify that all participants have it enabled.
    at mx.messaging.messages::MessagePerformanceUtils()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\messages\]
    at traderdesktop/messageHandler()[C:\Projects\Flex\marketdata\src\traderdesktop.mxml:144]
    at mx.messaging::AbstractConsumer/[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\
    at mx.messaging::ConsumerMessageDispatcher/messageHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\]
    at mx.messaging::ChannelSet/messageHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\]
    at PollCommandMessageResponder/resultHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\channels\]
    at mx.messaging::MessageResponder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\messaging\]

    i think i have all well configured, but the MessageEvent dont has the mpi information.

    I really appreciate some help !

  2. Andrey says:

    If you still get “Message is missing MPI headers” error, check out my post ( It might help.

  3. Thanks Andrey 🙂

  4. jay says:

    We are using MessagePerformanceUtils for measuring total time and time required for server. if we use flex 3.2.0 and java 1.5 as middletier, we get both these values as +ve. But when we moved to Java 1.6 we begin to get total time as -ve. Is there any compatability issue of lfex 3.2.0 with Java 1.6???

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: