Vordel Home
Products Customers partners library resources company
Follow Us on:


Pro Tip: Find Out How Long a Web Service Call Takes

Cloud Zone
May 1st, 2012
by Mark O’Neill

The Enterprise Integration Zone is presented by DZone and FuseSource. Check out the EI Zone for real world integration scenarios to help you learn which technology will give you the most elegant solution. For open source systems based on Apache Camel, ActiveMQ, or ServiceMix, look into FuseSource's training and technology.
Niall Commiskey has written a really useful guide to measuring the time a Gateway takes to call a Web Service. I recommend you check it out if you're interested in this information. One thing I'd add is that Niall is timing how long a Web Service filter takes to run. The Web Service filter may be doing other things, in addition to calling the Web Service (e.g. it may be doing Schema validation on the message). So the timing is showing how long all of these things take, together. If you call an API or Web Service using a "Connect to URL" filter (as explained in this blog post) then all it is doing is making the call.

To add to Niall's information, here are some other ways you can find this information about how long a Web Service call takes:

1) Use Traffic Monitor. This is available by default by pointing a browser to 8090 on the Gateway. It shows in milliseconds how long each processing step at the Gateway takes, including calls to external Web Services or APIs.

2) Use SR . In the example below, I am using the SR tool (which comes with the free SOAPbox download) to call a Google search API over SSL. You can see it tells me the time the request took. If I want to send many requests, I can do that with the -c (count) and -p (parallel threads) parameters.

01.C:\soapbox\sr>sr -C -h www.google.com -s 443 -u "/search?as_q=vordel" -v GET -V
02.1.1 -qq
03.will use HTTPS sessions
04.remote host = www.google.com
05.service=443
06.URI = "/search?as_q=vordel"
07.verb = "GET"
08.HTTP client version 1.1
09.quiet
10.quiet
11.2210 ranges from 0 to 3653.903699
12.add header Connection: close
13.add header Content-Length: 0
14.1 threads started
15.time taken: 0.374000 secs.
16.bytes sent: 0.000071MB (ju octets)
17.bytes received: 0.051882MB (ju octets)
18.transactions: 1
19.connections: 1
20.sslConnections: 1
21.sslSessionsReused: 0
22.bytes sent/sec: 0.000189MB (197.860963 octets)
23.bytes received/sec: 0.138721MB (145459.893048 octets)
24.transactions/sec: 2.673797
25.protocol/connection errors: 0
26.transactions by HTTP response code:
27.code=200, count=1

Published at DZone with permission of Mark O'neill, author and DZone MVB (source).

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)
Enterprise Integration is a huge problem space for developers, and with so many different technologies to choose from, finding the most elegant solution can be tricky. The Enterprise Integration Zone is a place for enterprise developers of all backgrounds to share design patterns and technology solutions that make integration easier for various scenarios. FuseSource proudly supports the EI Zone and provides its own gamut of training, services, and tools based on Apache Camel, ActiveMQ, CXF, and ServiceMix.