Browse Source

Have session_count return a dictionary

master
Neil Booth 8 years ago
parent
commit
12ed9f7069
  1. 5
      server/protocol.py

5
server/protocol.py

@ -156,7 +156,10 @@ class ServerManager(LoggedClass):
return self.irc.peers return self.irc.peers
def session_count(self): def session_count(self):
return len(self.sessions) '''Returns a dictionary.'''
active = len(s for s in self.sessions if s.send_count)
total = len(self.sessions)
return {'active': active, 'inert': total - active, 'total': total}
def address_count(self): def address_count(self):
return sum(len(session.hash168s) for session in self.sessions return sum(len(session.hash168s) for session in self.sessions

Loading…
Cancel
Save