Browse Source

Merge pull request #2726 from yichengq/init-sstat

etcdserver: init server stats before passing it as argument
Yicheng Qin 10 years ago
parent
commit
46d743f389
1 changed files with 1 additions and 1 deletions
  1. 1 1
      etcdserver/server.go

+ 1 - 1
etcdserver/server.go

@@ -248,6 +248,7 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
 		Name: cfg.Name,
 		ID:   id.String(),
 	}
+	sstats.Initialize()
 	lstats := stats.NewLeaderStats(id.String())
 
 	srv := &EtcdServer{
@@ -297,7 +298,6 @@ func (s *EtcdServer) start() {
 	s.w = wait.New()
 	s.done = make(chan struct{})
 	s.stop = make(chan struct{})
-	s.stats.Initialize()
 	// TODO: if this is an empty log, writes all peer infos
 	// into the first entry
 	go s.run()