Skip to content

Commit

Permalink
Merge pull request #3146 from a-robinson/snap
Browse files Browse the repository at this point in the history
snap: Record the snapshot save duration on success rather than only on error
  • Loading branch information
xiang90 committed Jul 16, 2015
2 parents 7d38115 + 57a5520 commit 40681bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snap/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 40681bd

Please sign in to comment.