diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-27 18:39:22 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-27 18:39:22 +0900 |
commit | 1a96b48b49bb1d38b36aad1c6532e9228c6b27b2 (patch) | |
tree | 7d2d202bbe7b7ea0dc383f749b3402c9391d8a55 /server/peer.go | |
parent | eef23350f3a1474e6a06abb6c5a097a5e1319ee5 (diff) |
cli: show the duration since state changed
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/peer.go')
-rw-r--r-- | server/peer.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/peer.go b/server/peer.go index bc8bb10c..51893421 100644 --- a/server/peer.go +++ b/server/peer.go @@ -300,6 +300,8 @@ func (peer *Peer) loop() error { peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList)) peer.fsm.peerConfig.BgpNeighborCommonState.Uptime = time.Now() peer.fsm.peerConfig.BgpNeighborCommonState.EstablishedCount++ + } else { + peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = time.Now() } sameState := true @@ -325,7 +327,6 @@ func (peer *Peer) loop() error { sameState = false if oldState == bgp.BGP_FSM_ESTABLISHED { t := time.Now() - peer.fsm.peerConfig.BgpNeighborCommonState.Downtime = t if t.Sub(peer.fsm.peerConfig.BgpNeighborCommonState.Uptime) < FLOP_THRESHOLD { peer.fsm.peerConfig.BgpNeighborCommonState.Flops++ } |