Well, your problem is that you have to first define "online" and "users".
If you want "the number of open WebSockets connected to the system", then you can do it using logic tied to the connect and disconnect methods, with extra logic for expiry in case you miss a disconnect (otherwise the number will continuously creep up over time). There is no simple, scalable way, however.
If you're going to have strictly less than 100 websockets connected, and you're using the Redis backend, then group_channels() would give you an approximation of that number simply, but the performance drops off dramatically as you scale up a system. It will also include connections that are up to a day old (or however long your group_expiry is)
Andrew