mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add "etcd_server_snapshot_apply_inflights_total"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
This commit is contained in:
parent
a4badc33a3
commit
06b82c200f
@ -76,6 +76,12 @@ var (
|
|||||||
Name: "slow_apply_total",
|
Name: "slow_apply_total",
|
||||||
Help: "The total number of slow apply requests (likely overloaded from slow disk).",
|
Help: "The total number of slow apply requests (likely overloaded from slow disk).",
|
||||||
})
|
})
|
||||||
|
applySnapshotInProgress = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
|
Namespace: "etcd",
|
||||||
|
Subsystem: "server",
|
||||||
|
Name: "snapshot_apply_in_progress_total",
|
||||||
|
Help: "1 if the server is applying the incoming snapshot. 0 if none.",
|
||||||
|
})
|
||||||
proposalsCommitted = prometheus.NewGauge(prometheus.GaugeOpts{
|
proposalsCommitted = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
Namespace: "etcd",
|
Namespace: "etcd",
|
||||||
Subsystem: "server",
|
Subsystem: "server",
|
||||||
@ -153,6 +159,7 @@ func init() {
|
|||||||
prometheus.MustRegister(leaderChanges)
|
prometheus.MustRegister(leaderChanges)
|
||||||
prometheus.MustRegister(heartbeatSendFailures)
|
prometheus.MustRegister(heartbeatSendFailures)
|
||||||
prometheus.MustRegister(slowApplies)
|
prometheus.MustRegister(slowApplies)
|
||||||
|
prometheus.MustRegister(applySnapshotInProgress)
|
||||||
prometheus.MustRegister(proposalsCommitted)
|
prometheus.MustRegister(proposalsCommitted)
|
||||||
prometheus.MustRegister(proposalsApplied)
|
prometheus.MustRegister(proposalsApplied)
|
||||||
prometheus.MustRegister(proposalsPending)
|
prometheus.MustRegister(proposalsPending)
|
||||||
|
@ -1113,6 +1113,7 @@ func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {
|
|||||||
if raft.IsEmptySnap(apply.snapshot) {
|
if raft.IsEmptySnap(apply.snapshot) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
applySnapshotInProgress.Inc()
|
||||||
|
|
||||||
lg := s.getLogger()
|
lg := s.getLogger()
|
||||||
if lg != nil {
|
if lg != nil {
|
||||||
@ -1138,6 +1139,7 @@ func (s *EtcdServer) applySnapshot(ep *etcdProgress, apply *apply) {
|
|||||||
} else {
|
} else {
|
||||||
plog.Infof("finished applying incoming snapshot at index %d", ep.snapi)
|
plog.Infof("finished applying incoming snapshot at index %d", ep.snapi)
|
||||||
}
|
}
|
||||||
|
applySnapshotInProgress.Dec()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if apply.snapshot.Metadata.Index <= ep.appliedi {
|
if apply.snapshot.Metadata.Index <= ep.appliedi {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user