Report metrics on all connection states

This commit is contained in:
Bryan Boreham committed 2016-11-02 09:51:13 +00:00
1 parent 2b4da35b1c
commit eb60f68df2
2 files changed
+9 -9

No files matched your search

+3 -1
View File
@@ -19,6 +19,8 @@ import (
weave "github.com/weaveworks/weave/router"
)
var allConnectionStates = []string{"established", "pending", "retrying", "failed", "connecting"}
var rootTemplate = template.New("root").Funcs(map[string]interface{}{
"countDNSEntries": countDNSEntries,
"printList": func(list []string) string {
@@ -87,7 +89,7 @@ var rootTemplate = template.New("root").Funcs(map[string]interface{}{
for _, conn := range conns {
counts[conn.State]++
}
return printCounts(counts, []string{"established", "pending", "retrying", "failed", "connecting"})
return printCounts(counts, allConnectionStates)
},
"printPeerConnectionCounts": func(peers []mesh.PeerStatus) string {
counts := make(map[string]int)