From 59f26ce5859d08194f787f3dd4da5d2dbf10596e Mon Sep 17 00:00:00 2001 From: Michael Baird Date: Tue, 30 May 2017 11:13:39 -0500 Subject: [PATCH] removed no-op stats tracking, fixed typos --- cache.go | 20 +++++++------------- cmd/import.go | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/cache.go b/cache.go index 6278a8c9e..c32881a29 100644 --- a/cache.go +++ b/cache.go @@ -50,7 +50,7 @@ type Cache interface { // Returns an ordered list of the top ranked bitmaps. Top() []BitmapPair - // SetStats defines the stats client used in the cache + // SetStats defines the stats client used in the cache. SetStats(s StatsClient) } @@ -93,17 +93,11 @@ func (c *LRUCache) Get(id uint64) uint64 { // Len returns the number of items in the cache. func (c *LRUCache) Len() int { return c.cache.Len() } -// Invalidate track size -func (c *LRUCache) Invalidate() { - c.stats.Count("cache.invalidate", 1, 1.0) - c.stats.Gauge("LRUCache", float64(c.cache.Len()), 1.0) -} +// Invalidate is a no-op. +func (c *LRUCache) Invalidate() {} -// Recalculate track size -func (c *LRUCache) Recalculate() { - c.stats.Count("cache.recalculate", 1, 1.0) - c.stats.Gauge("LRUCache", float64(c.cache.Len()), 1.0) -} +// Recalculate is a no-op. +func (c *LRUCache) Recalculate() {} // IDs returns a list of all IDs in the cache. func (c *LRUCache) IDs() []uint64 { @@ -128,7 +122,7 @@ func (c *LRUCache) Top() []BitmapPair { return a } -// SetStats passes the stats client used the the frame that owns the cache +// SetStats defines the stats client used in the cache. func (c *LRUCache) SetStats(s StatsClient) { c.stats = s } @@ -283,7 +277,7 @@ func (c *RankCache) recalculate() { } } -// SetStats passes the stats client used the the frame that owns the cache +// SetStats defines the stats client used in the cache. func (c *RankCache) SetStats(s StatsClient) { c.stats = s } diff --git a/cmd/import.go b/cmd/import.go index 07f91f8b6..bd4be6a9d 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -25,7 +25,7 @@ import ( var Importer *ctl.ImportCommand -// NewImportCommand runs the Pilosa import subcommand for ingesting bulk data +// NewImportCommand runs the Pilosa import subcommand for ingesting bulk data. func NewImportCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command { Importer = ctl.NewImportCommand(stdin, stdout, stderr) importCmd := &cobra.Command{