Skip to content

Commit

Permalink
etcdserver/stats: make all fields guarded by mutex.
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing committed Apr 12, 2018
1 parent ba59bb2 commit 10bf028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etcdserver/stats/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (ss *ServerStats) JSON() []byte {
stats := ss.serverStats
stats.SendingPkgRate, stats.SendingBandwidthRate = stats.sendRateQueue.Rate()
stats.RecvingPkgRate, stats.RecvingBandwidthRate = stats.recvRateQueue.Rate()
ss.Unlock()
stats.LeaderInfo.Uptime = time.Since(stats.LeaderInfo.StartTime).String()
ss.Unlock()
b, err := json.Marshal(stats)
// TODO(jonboulle): appropriate error handling?
if err != nil {
Expand Down

0 comments on commit 10bf028

Please sign in to comment.