Java Reference
In-Depth Information
THINK TIME AND THROUGHPUT
The throughput of a test where the clients include think time can be measured in two ways. The
simplest way is for clients to sleep for a period of time between requests:
while
while (! done ) {
time = executeOperation ();
Thread . currentThread (). sleep ( 30 * 1000 );
}
In this case, the throughput is somewhat dependent on the response time. If the response time is 1
second, it means that the client will send a request every 31 seconds, which will yield a through-
put of 0.032 OPS. If the response time is 2 seconds, each client will send a request every 32
seconds, yielding a throughput of 0.031 OPS.
The other alternative is known as cycle time (rather than think time). Cycle time sets the total
time between requests to 30 seconds, so that the time the client sleeps depends on the response
time:
while
while (! done ) {
time = executeOperation ();
Thread . currentThread (). sleep ( 30 * 1000 - time );
}
This alternative yields a fixed throughput of 0.033 OPS per client regardless of the response time
(assuming the response time is always less than 30 seconds in this example).
Think times in testing tools often vary by design; they will average a particular value but use ran-
dom variation to better simulate what users do. In addition, thread scheduling is never exactly
real-time, so the actual time between the requests a client sends will vary slightly.
As a result, even when using a tool that provides a cycle time instead of a think time, the reported
throughput between runs will vary slightly. But if the throughput is far from the expected value,
something has gone wrong in the execution of the test.
There are two ways of measuring response time. Response time can be reported as an aver-
age: the individual times are added together and divided by the number of requests. Response
time can also be reported as a percentile request, for example the 90th% response time. If
90% of responses are less than 1.5 seconds and 10% of responses are greater than 1.5
seconds, then 1.5 seconds is the 90th% response time.
Search WWH ::




Custom Search