title: socket.io get all rooms with number of clients connected
body: <p>I am now using socket.io with multiple nodes hence I started using the socket.io-redis adapter (<a href="https://github.com/socketio/socket.io-redis" rel="nofollow noreferrer">https://github.com/socketio/socket.io-redis</a>) to help me sync between nodes.</p>
  
  <p>I would like to get a list of all the rooms on the server and a corresponding number of clients in each room efficiently. </p>
  
  <p>At any one time I may have thousands of rooms and would like to get a count quickly of each room.</p>
  
  <p>To get a list of all the rooms I would do:</p>
  
  <pre><code>io.of('/').adapter.allRooms((err, rooms) =&gt; {
    console.log(rooms); // an array containing all rooms (accross every node)
  });
  </code></pre>
  
  <p>This returns a list of all the rooms, but at this point I am unsure how many connections each user has. </p>
  
  <p>I could then run the next query to get the count for each room individually:</p>
  
  <pre><code>//query the first room, second room and so on...
  io.in('firstroom').clients((err, clients) =&gt; {
    console.log(clients); // an array containing socket ids in 'room3'. Aggregate them to get the count
  });
  </code></pre>
  
  <p>This seems very inefficient as I will be making so many calls to get the count individually. Is there a more efficient way than this to get a list of all the rooms with an associated count of connections? I have looked into modifying the adapter code but I do not really understand the code all that well to make any changes. </p>