mirror of https://github.com/status-im/consul.git
consul: Passthrough the Serf Stats()
This commit is contained in:
parent
76ec9d22b1
commit
1b1cb3be11
|
@ -317,12 +317,10 @@ func (c *Client) Stats() map[string]map[string]string {
|
|||
}
|
||||
stats := map[string]map[string]string{
|
||||
"consul": map[string]string{
|
||||
"server": "false",
|
||||
},
|
||||
"serf-lan": map[string]string{
|
||||
"members": toString(uint64(len(c.serf.Members()))),
|
||||
"servers": toString(uint64(len(c.consuls))),
|
||||
"server": "false",
|
||||
"known_servers": toString(uint64(len(c.consuls))),
|
||||
},
|
||||
"serf-lan": c.serf.Stats(),
|
||||
}
|
||||
return stats
|
||||
}
|
||||
|
|
|
@ -462,18 +462,14 @@ func (s *Server) Stats() map[string]map[string]string {
|
|||
}
|
||||
stats := map[string]map[string]string{
|
||||
"consul": map[string]string{
|
||||
"server": "true",
|
||||
"leader": fmt.Sprintf("%v", s.IsLeader()),
|
||||
"bootstrap": fmt.Sprintf("%v", s.config.Bootstrap),
|
||||
},
|
||||
"raft": s.raft.Stats(),
|
||||
"serf-lan": map[string]string{
|
||||
"members": toString(uint64(len(s.serfLAN.Members()))),
|
||||
},
|
||||
"serf-wan": map[string]string{
|
||||
"members": toString(uint64(len(s.serfWAN.Members()))),
|
||||
"datacenters": toString(uint64(len(s.remoteConsuls))),
|
||||
"server": "true",
|
||||
"leader": fmt.Sprintf("%v", s.IsLeader()),
|
||||
"bootstrap": fmt.Sprintf("%v", s.config.Bootstrap),
|
||||
"known_datacenters": toString(uint64(len(s.remoteConsuls))),
|
||||
},
|
||||
"raft": s.raft.Stats(),
|
||||
"serf-lan": s.serfLAN.Stats(),
|
||||
"serf-wan": s.serfWAN.Stats(),
|
||||
}
|
||||
return stats
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue