From 100fcfdc6ba0b42f372395c016d44067631dd988 Mon Sep 17 00:00:00 2001 From: Linh Vo Date: Thu, 20 Apr 2017 21:39:47 -0500 Subject: [PATCH] reformat --- db.go | 20 ++++++++++---------- frame.go | 26 +++++++++++++------------- stats.go | 16 +++++++--------- stats_test.go | 2 +- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/db.go b/db.go index 8c176bb79..3cfbf23e1 100644 --- a/db.go +++ b/db.go @@ -22,31 +22,31 @@ const ( // DB represents a container for frames. type DB struct { - mu sync.Mutex - path string - name string + mu sync.Mutex + path string + name string // Default time quantum for all frames in database. // This can be overridden by individual frames. - timeQuantum TimeQuantum + timeQuantum TimeQuantum // Label used for referring to columns in database. - columnLabel string + columnLabel string // Frames by name. - frames map[string]*Frame + frames map[string]*Frame // Max Slice on any node in the cluster, according to this node remoteMaxSlice uint64 remoteMaxInverseSlice uint64 // Profile attribute storage and cache - profileAttrStore *AttrStore + profileAttrStore *AttrStore - broadcaster Broadcaster - Stats StatsClient + broadcaster Broadcaster + Stats StatsClient - LogOutput io.Writer + LogOutput io.Writer } // NewDB returns a new instance of DB. diff --git a/frame.go b/frame.go index 63c06f7c1..d173d9a07 100644 --- a/frame.go +++ b/frame.go @@ -27,29 +27,29 @@ const ( // Frame represents a container for views. type Frame struct { - mu sync.Mutex - path string - db string - name string - timeQuantum TimeQuantum + mu sync.Mutex + path string + db string + name string + timeQuantum TimeQuantum - views map[string]*View + views map[string]*View // Bitmap attribute storage and cache bitmapAttrStore *AttrStore - broadcaster Broadcaster - Stats StatsClient + broadcaster Broadcaster + Stats StatsClient // Frame settings. - rowLabel string - cacheType string - inverseEnabled bool + rowLabel string + cacheType string + inverseEnabled bool // Cache size for ranked frames - cacheSize uint32 + cacheSize uint32 - LogOutput io.Writer + LogOutput io.Writer } // NewFrame returns a new instance of frame. diff --git a/stats.go b/stats.go index 07c11a2f3..057d46320 100644 --- a/stats.go +++ b/stats.go @@ -47,14 +47,14 @@ var NopStatsClient StatsClient // nopStatsClient represents a client that doesn't do anything. type nopStatsClient struct{} -func (c *nopStatsClient) Tags() []string { return nil } -func (c *nopStatsClient) WithTags(tags ...string) StatsClient { return c } -func (c *nopStatsClient) Count(name string, value int64) {} +func (c *nopStatsClient) Tags() []string { return nil } +func (c *nopStatsClient) WithTags(tags ...string) StatsClient { return c } +func (c *nopStatsClient) Count(name string, value int64) {} func (c *nopStatsClient) CountWithCustomTags(name string, value int64, tags []string) {} -func (c *nopStatsClient) Gauge(name string, value float64) {} -func (c *nopStatsClient) Histogram(name string, value float64) {} -func (c *nopStatsClient) Set(name string, value string) {} -func (c *nopStatsClient) Timing(name string, value time.Duration) {} +func (c *nopStatsClient) Gauge(name string, value float64) {} +func (c *nopStatsClient) Histogram(name string, value float64) {} +func (c *nopStatsClient) Set(name string, value string) {} +func (c *nopStatsClient) Timing(name string, value time.Duration) {} // ExpvarStatsClient writes stats out to expvars. type ExpvarStatsClient struct { @@ -150,14 +150,12 @@ func (a MultiStatsClient) Count(name string, value int64) { } } - func (a MultiStatsClient) CountWithCustomTags(name string, value int64, tags []string) { for _, c := range a { c.CountWithCustomTags(name, value, tags) } } - // Gauge sets the value of a metric on all clients. func (a MultiStatsClient) Gauge(name string, value float64) { for _, c := range a { diff --git a/stats_test.go b/stats_test.go index 248b68ea0..cf06f2f06 100644 --- a/stats_test.go +++ b/stats_test.go @@ -160,4 +160,4 @@ func (c *MockStats) WithTags(tags ...string) pilosa.StatsClient { return c } func (c *MockStats) Gauge(name string, value float64) {} func (c *MockStats) Histogram(name string, value float64) {} func (c *MockStats) Set(name string, value string) {} -func (c *MockStats) Timing(name string, value time.Duration) {} \ No newline at end of file +func (c *MockStats) Timing(name string, value time.Duration) {}