Skip to content

Commit

Permalink
fix statistics logging code
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle committed Feb 8, 2011
1 parent fa57203 commit f013860
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class Peer(bgp.Protocol):
def __init__(self):
bgp.Protocol.__init__(self)
self.rib = {}
if self.factory.config['statistics']:
self.logTableStats()
self.logTableStats()

def logTableStats(self):
log.msg('STATS (%s-%s): adj_rib: %s routes\ttotal: %s routes' % (self.peer['bgp_identifier'], self.peer['sender_as'], len(self.rib), self.total_routes))
reactor.callLater(5.0, self.logTableStats)
if self.factory.config.get('statistics'):
log.msg('STATS (%s-%s): adj_rib: %s routes\ttotal: %s routes' % (self.peer['bgp_identifier'], self.peer['sender_as'], len(self.rib), self.total_routes))
reactor.callLater(5.0, self.logTableStats)

def messageReceived(self, message):
# Called whenever a BGP message arrives from a peer
Expand Down

0 comments on commit f013860

Please sign in to comment.