mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

This adds the remaining two stats endpoints: `/v2/stats/self`, for various statistics on the EtcdServer, and `/v2/stats/leader`, for statistics on a leader's followers. By and large most of the stats code is copied across from 0.4.x, updated where necessary to integrate with the new decoupling of raft from transport. This does not satisfactorily resolve the question of name vs ID. In the old world, names were unique in the cluster and transmitted over the wire, so they could be used safely in all statistics. In the new world, a given EtcdServer only knows its own name, and it is instead IDs that are communicated among the cluster members. Hence in most places here we simply substitute a string-encoded ID in place of name, and only where possible do we retain the actual given name of the EtcdServer.