Reputation: 1413
I have a the following scenarios. I am trying to calculate throughput of the java's XSLT transformer. I have 10 threrads, each iterates 1000 times. The task of the thread is to read the XML and XSLT file and trasnform it and write to a new file.
I want to calculate the TPS. Can you please suggest the way to calculate TPS?
Thanks and Regards,
Srinivas.
Upvotes: 5
Views: 6431
Reputation: 70201
Well, you want to start a timer at the beginning and stop it when all threads complete. That gives you elapsed time = end time - begin time. Transactions = 10 threads * 1000 iterations = 10000. TPS = 10000 / elapsed time.
The easiest way to do this kind of timing is with a CyclicBarrier. Here's a good writeup of using a barrier action with a CyclicBarrier as a timer (see last example):
My final caveat would be that benchmarking something like this is fraught with peril. Some suggestions:
Upvotes: 5