on ‎2012 Mar 21 11:52 AM
How would you figure out what how many users were ever logged in at the same time?
I am trying to come up with some testing scenarios for our software, and I know how many users there are total for a given site, and therefore how many possibly could be logged in at the same time. But I was wondering if there was a counter in the DB that I could query that kept track of how many actually ever were logged in at the same time historically.
Request clarification before answering.
An old-school solution for the maximum number of connections to this database...
CREATE TABLE max_connected_users (
on_date DATE NOT NULL PRIMARY KEY,
max_connections INTEGER NOT NULL );
CREATE EVENT record_max_connections TYPE CONNECT HANDLER
BEGIN
INSERT max_connected_users
ON EXISTING SKIP
VALUES ( CURRENT DATE, 0 );
UPDATE max_connected_users
SET max_connections = GREATER ( max_connections, DB_PROPERTY ( 'ConnCount' ) )
WHERE on_date = CURRENT DATE;
END;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Breck: "Old-school" - so you don't code MERGE all the day? 🙂
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.