ChanGan
ChanGan

Reputation: 4318

How to count number of logged in users using Jmeter?

I am currently testing my application with 1000 users.

Active: 55 Started: 55 Finished: 0 summary =     76 in 00:01:48 =    0.7/s Avg: 11375 Min:  1335 Max: 32812 Err: 76 (100.00%)

I just wanted to see how many users logged in currently so that i can understand how it behaves on x concurrent users.

But Just tried that when application is down, But it says that Active 55 and Started 55. But no users has logged due to app is down.

In that case how we can say just by seeeing thread only and it is 55 users. Is there any way that only logged in users by asserting or any other way?

Thanks for the help

Upvotes: 0

Views: 1406

Answers (2)

Dmitri T
Dmitri T

Reputation: 168082

You can add a Response Assertion which will explicitly test whether user is logged in or not by looking for some indicator of being logged in in the response body, for example Welcome text or Logout link presence or whatever.

This way you will be able to look into i.e. Aggregate Report listener and look for number of successful and failed samplers. Also a good idea is to generate HTML Reporting Dashboard so you will be able to see how many users were online in the given time frame, correlate increasing response time and number of errors with increasing amount of virtual users, etc.

Upvotes: 0

Masud Jahan
Masud Jahan

Reputation: 2978

If you want to see the number of active threads currently on the server, check the Active Threads Over Time listener. By using this, you can see the active threads during test run. It will show results in graph for every seconds.

You can easily install this plugins by using Plugins Manager.

In your summary results, it is clearly shown that all of your 55 active threads are making 76 requests are getting failed. If those requests are login requests then all of them are failed. So, there is no logged in users currently. Don't get confused with the threads and requests. Remember, Threads are making requests on your application server. So your 55 threads are making 76 login requests in 1 min 48 seconds (108 seconds) in which all of them are getting failed. Hence your throughput is 0.7 req/sec (76/108). There is no successful login requests, so error rate is 100%.

To validate this, you can also check the application server log that how many users are logged in currently on that server.

Upvotes: 1

Related Questions