mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Added RFE about connected time.
This commit is contained in:
parent
1d6d200cc4
commit
74208016df
@ -58,6 +58,7 @@ class Status(callbacks.Privmsg):
|
||||
self.recvdMsgs = 0
|
||||
self.sentBytes = 0
|
||||
self.recvdBytes = 0
|
||||
self.connected = {}
|
||||
|
||||
def __call__(self, irc, msg):
|
||||
self.recvdMsgs += 1
|
||||
@ -69,15 +70,21 @@ class Status(callbacks.Privmsg):
|
||||
self.sentBytes += len(msg)
|
||||
return msg
|
||||
|
||||
def do001(self, irc, msg):
|
||||
self.connected[irc] = time.time()
|
||||
|
||||
def net(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
||||
Returns some interesting network-related statistics.
|
||||
"""
|
||||
elapsed = time.time() - self.connected[irc.getRealIrc()]
|
||||
irc.reply('I have received %s messages for a total of %s bytes. '
|
||||
'I have sent %s messages for a total of %s bytes.' %
|
||||
'I have sent %s messages for a total of %s bytes. '
|
||||
'I have been connected to this network for %s.' %
|
||||
(self.recvdMsgs, self.recvdBytes,
|
||||
self.sentMsgs, self.sentBytes))
|
||||
self.sentMsgs, self.sentBytes,
|
||||
utils.timeElapsed(elapsed)))
|
||||
|
||||
def cpu(self, irc, msg, args):
|
||||
"""takes no arguments
|
||||
|
Loading…
Reference in New Issue
Block a user