mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
snap: Record the snapshot save duration on success rather than only on error.
It makes more sense to record the latency of successes (or all attempts) than of only a particular failure case.
This commit is contained in:
parent
ebbb0caff0
commit
57a5520157
@ -75,7 +75,7 @@ func (s *Snapshotter) save(snapshot *raftpb.Snapshot) error {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(path.Join(s.dir, fname), d, 0666)
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
saveDurations.Observe(float64(time.Since(start).Nanoseconds() / int64(time.Microsecond)))
|
||||
}
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user