Sub calculates and returns the difference between two sets of transaction stats. This is useful when obtaining stats at two different points and time and you need the performance counters that occurred within that time span.
(other *TxStats)
| 758 | // This is useful when obtaining stats at two different points and time and |
| 759 | // you need the performance counters that occurred within that time span. |
| 760 | func (s *TxStats) Sub(other *TxStats) TxStats { |
| 761 | var diff TxStats |
| 762 | diff.PageCount = s.GetPageCount() - other.GetPageCount() |
| 763 | diff.PageAlloc = s.GetPageAlloc() - other.GetPageAlloc() |
| 764 | diff.CursorCount = s.GetCursorCount() - other.GetCursorCount() |
| 765 | diff.NodeCount = s.GetNodeCount() - other.GetNodeCount() |
| 766 | diff.NodeDeref = s.GetNodeDeref() - other.GetNodeDeref() |
| 767 | diff.Rebalance = s.GetRebalance() - other.GetRebalance() |
| 768 | diff.RebalanceTime = s.GetRebalanceTime() - other.GetRebalanceTime() |
| 769 | diff.Split = s.GetSplit() - other.GetSplit() |
| 770 | diff.Spill = s.GetSpill() - other.GetSpill() |
| 771 | diff.SpillTime = s.GetSpillTime() - other.GetSpillTime() |
| 772 | diff.Write = s.GetWrite() - other.GetWrite() |
| 773 | diff.WriteTime = s.GetWriteTime() - other.GetWriteTime() |
| 774 | return diff |
| 775 | } |
| 776 | |
| 777 | // GetPageCount returns PageCount atomically. |
| 778 | func (s *TxStats) GetPageCount() int64 { |