etcdserver/api/v2stats/server.go
func (ss *ServerStats) RecvAppendReq(leader string, reqSize int) {
	ss.Lock()
	defer ss.Unlock()

	now := time.Now()

	ss.State = raft.StateFollower
	if leader != ss.LeaderInfo.Name {
		ss.LeaderInfo.Name = leader
		ss.LeaderInfo.StartTime = now
	}

	ss.recvRateQueue.Insert(
		&RequestStats{
			SendingTime: now,
			Size:        reqSize,
		},
	)
	ss.RecvAppendRequestCnt++
}
func (ss *ServerStats) RecvAppendReq(leader string, reqSize int) {
	ss.Lock()
	defer ss.Unlock()

	now := time.Now()

	ss.State = raft.StateFollower
	if leader != ss.LeaderInfo.Name {
		ss.LeaderInfo.Name = leader
		ss.LeaderInfo.StartTime = now
	}

	ss.recvRateQueue.Insert(
		&RequestStats{
			SendingTime: now,
			Size:        reqSize,
		},
	)
	ss.RecvAppendRequestCnt++
}
func ( ss * ServerStats ) RecvAppendReq ( leader string , reqSize int ) { ss . Lock ( ) defer ss . Unlock ( ) now := time . Now ( ) ss . State = raft . StateFollower if leader != ss . LeaderInfo . Name { ss . LeaderInfo . Name = leader ss . LeaderInfo . StartTime = now } ss . recvRateQueue . Insert ( & RequestStats { SendingTime : now , Size : reqSize , } , ) ss . RecvAppendRequestCnt ++ }
// RecvAppendReq updates the ServerStats in response to an AppendRequest
// from the given leader being received
RecvAppendReq updates the ServerStats in response to an AppendRequest from the given leader being received