#NEWLINE# @ idiokit . stream #NEWLINE# def _log_stats( self , interval = 15.0 ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# ( yield idiokit . sleep ( interval ) ) #NEWLINE# for ( room , ( seen , sent ) ) in self . _stats . iteritems ( ) : #NEWLINE# #INDENT# self . log . info ( 'Room {0}: seen {1}, sent {2} events' . format ( room , seen , sent ) , event = events . Event ( { #NEWLINE# #INDENT# 'type' : 'room' , #NEWLINE# 'service' : self . bot_name , #NEWLINE# 'seen events' : unicode ( seen ) , #NEWLINE# 'sent events' : unicode ( sent ) , #NEWLINE# 'room' : unicode ( room ) , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# self . _stats . clear ( )