Foreach all online players, have a check if the player is on isSleeping(), and just count them? Not sure if this is what you want :/