mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver/api/rafthttp: document round-trip metrics, clean up
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
5a9e48be30
commit
640f5e64a9
@ -53,7 +53,7 @@ var (
|
||||
[]string{"From"},
|
||||
)
|
||||
|
||||
rtts = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
rttSec = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: "etcd",
|
||||
Subsystem: "network",
|
||||
Name: "peer_round_trip_time_seconds",
|
||||
@ -72,5 +72,5 @@ func init() {
|
||||
prometheus.MustRegister(receivedBytes)
|
||||
prometheus.MustRegister(sentFailures)
|
||||
prometheus.MustRegister(recvFailures)
|
||||
prometheus.MustRegister(rtts)
|
||||
prometheus.MustRegister(rttSec)
|
||||
}
|
||||
|
@ -44,9 +44,10 @@ func addPeerToProber(lg *zap.Logger, p probing.Prober, id string, us []string) {
|
||||
} else {
|
||||
plog.Errorf("failed to add peer %s into prober", id)
|
||||
}
|
||||
} else {
|
||||
go monitorProbingStatus(lg, s, id)
|
||||
return
|
||||
}
|
||||
|
||||
go monitorProbingStatus(lg, s, id)
|
||||
}
|
||||
|
||||
func monitorProbingStatus(lg *zap.Logger, s probing.Status, id string) {
|
||||
@ -83,7 +84,8 @@ func monitorProbingStatus(lg *zap.Logger, s probing.Status, id string) {
|
||||
plog.Warningf("the clock difference against peer %s is too high [%v > %v]", id, s.ClockDiff(), time.Second)
|
||||
}
|
||||
}
|
||||
rtts.WithLabelValues(id).Observe(s.SRTT().Seconds())
|
||||
rttSec.WithLabelValues(id).Observe(s.SRTT().Seconds())
|
||||
|
||||
case <-s.StopNotify():
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user