Hi, On Sat, Feb 25, 2012 at 2:25 AM, Yogesh Sagar <[email protected]> wrote:
> Thanks Sadeep. Basically, my intent is to create an MBean through Synapse. > A mediator which would be an MBean and I can monitor it using JConsole and > view the stats. I know in the synapse source there are few MBeans and I am > trying to understand the design of those MBeans with regards to how the > statistics are collected etc. I am trying to build something similar to > ConnectionsViewMBean which would basically record how long it took for an > endpoint to process the request and return the results back to client. > > This kind of a calculation is already done within Synapse's NHTTP transport code to calculate latency statistics (statistics exposed with NHTTPLatencyView MBean). Latency = Total time the message spent within the ESB = (t2 - t1) + (t4 - t3) Where, t1 = request arrival time t2 = request departure time t3 = response arrival time t4 = response departure time For your purpose, I believe you need an MBean to expose the average (t3 - t2). Since t3 and t2 are already recorded for latency calculation, writing an MBean to expose the average (t3 - t2) should not be a complex task. > Correct me if I wrong, is MessageContext shared between an input and output > sequence? I believe MessageContext is built on every request and response. > Synapse MessageContext (which is different from Axis2 MessageContext) is built for every request received by Synapse and remains until the response for that message is sent back to the client. This means that, when a single request to Synapse is considered, same message context is used for it's in sequence and out sequence. Thanks, Sadeep > > Cheers, > Yogesh > > On Thu, Feb 23, 2012 at 7:37 PM, Sadeep Jayasumana <[email protected] > >wrote: > > > Hi, > > > > Yes, Synapse does have JMX monitoring capabilities. Please refer to WSO2 > > ESB's monitoring guide [1] for more details. Since WSO2 ESB embeds > Synapse, > > this documentation should be applicable to Synapse as well. > > > > From all the statistics provided via JMX, for your usecase you might find > > NHTTP latency statistics useful. > > > > [1] > > > http://wso2.org/project/esb/java/4.0.3/docs/monitoring.html#JMXMonitoring > > > > Thanks, > > Sadeep > > > > On Fri, Feb 24, 2012 at 8:01 AM, Yogesh Sagar <[email protected]> > > wrote: > > > > > Hello, > > > > > > I am trying to do some performance monitoring on some of the endpoints. > > How > > > can I monitor performance in synapse? Is there a JMX support in > Synapse? > > My > > > thoughts are to write a in mediator which will basically record the > start > > > time etc etc and then wrote the out mediator which would measure > > > performance or gather statistics. Any ideas or pointers is very much > > > appreciated. > > > > > > Thanks, > > > Yogesh > > > > > > > > > > > -- > > > > Sadeep Jayasumana > > > > ** > > > > Email: [email protected]**** > > > > Mobile: +61 4 1468 8521 > > > -- Sadeep Jayasumana ** Email: [email protected]**** Mobile: +61 4 1468 8521
