[英]Calculate Throughput
I have a the following scenarios. 我有以下场景。 I am trying to calculate throughput of the java's XSLT transformer.
我正在尝试计算java的XSLT转换器的吞吐量。 I have 10 threrads, each iterates 1000 times.
我有10个threrads,每次迭代1000次。 The task of the thread is to read the XML and XSLT file and trasnform it and write to a new file.
该线程的任务是读取XML和XSLT文件并对其进行转换并写入新文件。
I want to calculate the TPS. 我想计算TPS。 Can you please suggest the way to calculate TPS?
你能建议一下计算TPS的方法吗?
Thanks and Regards, 感谢致敬,
Srinivas. SRINIVAS。
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.
事务= 10个线程* 1000个迭代= 10000.TPS = 10000 /经过时间。
The easiest way to do this kind of timing is with a CyclicBarrier. 使用CyclicBarrier进行此类计时的最简单方法。 Here's a good writeup of using a barrier action with a CyclicBarrier as a timer (see last example):
这是一个很好的写作,使用一个带有CyclicBarrier作为计时器的屏障动作(参见最后一个例子):
My final caveat would be that benchmarking something like this is fraught with peril. 我最后的警告是,像这样的基准测试充满了危险。 Some suggestions:
一些建议:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.