firemonkey
firemonkey

Reputation: 329

Blazeds service time stats

My Application : I have java remoting services(more then 25) on my (Tomcat BlazeDS)server which are called from my Flex client application.

My Requirment : I need to collect stats on them like how much time each service is taking(total time).

There are three approaches I can do this in my opinion(may be more)

1) change each service and add timer at beginning and ending. --- bad practice 2) I can also use AOP but I feel its an over kill for this requirement. --- over kill 3) servlet Filter. ---- Good option

   I really like option three but I am not sure how to do this with BlazeDS. Can it be done and if so any example/direction would be great.

thank you

Upvotes: 0

Views: 230

Answers (3)

firemonkey
firemonkey

Reputation: 329

I have found the solution :

I extend JavaAdaptor and in invoke method, I can get destination name and total time.

thank you

Upvotes: 1

cliff.meyers
cliff.meyers

Reputation: 17734

In order to use the ServletFilter it will need to deserialize the raw HTTP request content from AMF into a graph of Java objects. If you can find an instance of AsyncMessage in the graph you can examine its "destination" property which maps directly to the service in question. It looks like you could use the MessageDeserializer from the BlazeDS APIs to do this but it also depends on some other objects to work.

Are you using Spring? If so, doing this with AOP is very easy.

Upvotes: 0

James Ward
James Ward

Reputation: 29433

I use a servlet filter to do this in my Census app. You can find the filter code on sourceforge.

Upvotes: 0

Related Questions