diff options
-rw-r--r-- | db.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -576,6 +576,18 @@ type Stats struct { // you need the performance counters that occurred within that time span. func (s *Stats) Sub(other *Stats) Stats { var diff Stats + if s == nil { + if other == nil { + return diff + } else { + return *other + } + } + diff = *s + if other == nil { + return diff + } + diff.TxN = other.TxN - diff.TxN diff.TxStats = s.TxStats.Sub(&other.TxStats) return diff } |