|
Re: [junitperf] Question on concurrent user
On Mar 21, 2006, at 11:45 AM, jadeite100 wrote:
> public static Test loadTestSuite()
> {
> // users=20 means 20 concurrent users at the same
> time
> int users = 4;
>
> // iterations=10 means run 10 times. Means run 200
> times
> int iterations = 1;
>
> // timer = ConstantTimer(1000) means between the
> interval between the iterations is 1 seconds.
> Timer timer = new ConstantTimer(1000);
>
> long maxElapsedTimeInMillis = 1000;
>
> Test factory = new TestMethodFactory
> (MailSortBatchServiceTest.class,"testMailSortBatchService");
> Test timedTest = new TimedTest
> (factory,maxElapsedTimeInMillis);
>
> LoadTest loadTest = new LoadTest
> (timedTest,users,iterations);
> loadTest.setEnforceTestAtomicity(true);
>
> return loadTest;
> }
> public static void main(String args[]) {
> // junit.textui.TestRunner.run(performanceTestSuite
> ());
> junit.textui.TestRunner.run(loadTestSuite());
> }
>
> }
>
> When I ran the above with 4 users, it gave me a result of 10.359
> seconds. When I changed to 100 users, and ran the result it gave me
> 10.282 seconds. I don't understand why would running 100 users would
> actually decrease the time from 10.359 to 10.282 seconds. Is this
> 10.282 seconds means each user only takes 10.282 seconds or the total
> number of seconds for 100 users running this is 10.282 seconds. Can
> someone please tell me what the 10.282 seconds means, please.
That's correct, it's measuring the response time of each user. I'm
not sure how you're seeing output. Paste it in here if you need more
help.
Mike
|