admin: ServerInfo() returns info for each node (#4150)

ServerInfo() will gather information from all nodes before returning
it back to the client.
This commit is contained in:
Anis Elleuch
2017-04-21 15:15:53 +01:00
committed by Harshavardhana
parent df346753e1
commit 83abad0b37
8 changed files with 197 additions and 110 deletions

View File

@@ -121,7 +121,9 @@ func (c *ConnMux) PeekProtocol() (string, error) {
// bytes received from the client.
func (c *ConnMux) Read(b []byte) (n int, err error) {
// Update total incoming number of bytes.
defer globalConnStats.incInputBytes(n)
defer func() {
globalConnStats.incInputBytes(n)
}()
n, err = c.peeker.Read(b)
if err != nil {
@@ -141,7 +143,9 @@ func (c *ConnMux) Read(b []byte) (n int, err error) {
// keeps track of the total bytes written by the server.
func (c *ConnMux) Write(b []byte) (n int, err error) {
// Update total outgoing number of bytes.
defer globalConnStats.incOutputBytes(n)
defer func() {
globalConnStats.incOutputBytes(n)
}()
// Call the conn write wrapper.
return c.Conn.Write(b)