diff options
Diffstat (limited to 'pkg/state/stats.go')
-rw-r--r-- | pkg/state/stats.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/state/stats.go b/pkg/state/stats.go index c4135a889..ddcc49f78 100644 --- a/pkg/state/stats.go +++ b/pkg/state/stats.go @@ -68,6 +68,17 @@ func (s *Stats) Add(obj reflect.Value) { entry.count++ } +// Remove removes a sample count. It should only be called after a previous +// Add(). +func (s *Stats) Remove(obj reflect.Value) { + if s == nil { + return + } + typ := obj.Type() + entry := s.byType[typ] + entry.count-- +} + // Start starts a sample. func (s *Stats) Start(obj reflect.Value) { if s == nil { |