From e2ef160d5fd0dfff3aa819ede006ac5943fa1aa5 Mon Sep 17 00:00:00 2001 From: Thomas Menard Date: Fri, 12 Feb 2016 15:00:49 +0100 Subject: [PATCH] Fix postgres plugin with testing ok with fmt --- plugins/inputs/postgresql/postgresql.go | 4 ++-- plugins/inputs/postgresql/postgresql_test.go | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/inputs/postgresql/postgresql.go b/plugins/inputs/postgresql/postgresql.go index c09590070..660f1b318 100644 --- a/plugins/inputs/postgresql/postgresql.go +++ b/plugins/inputs/postgresql/postgresql.go @@ -4,8 +4,8 @@ import ( "bytes" "database/sql" "fmt" - "strings" "sort" + "strings" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/plugins/inputs" @@ -17,7 +17,7 @@ type Postgresql struct { Address string Databases []string OrderedColumns []string - AllColumns []string + AllColumns []string } var ignoredColumns = map[string]bool{"datid": true, "datname": true, "stats_reset": true} diff --git a/plugins/inputs/postgresql/postgresql_test.go b/plugins/inputs/postgresql/postgresql_test.go index 8baaad9ae..552b18cdb 100644 --- a/plugins/inputs/postgresql/postgresql_test.go +++ b/plugins/inputs/postgresql/postgresql_test.go @@ -23,7 +23,7 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) { var acc testutil.Accumulator err := p.Gather(&acc) require.NoError(t, err) - + availableColumns := make(map[string]bool) for _, col := range p.AllColumns { availableColumns[col] = true @@ -43,15 +43,15 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) { "temp_bytes", "deadlocks", "numbackends", - "buffers_alloc", - "buffers_backend", - "buffers_backend_fsync", - "buffers_checkpoint", - "buffers_clean", - "checkpoints_req", - "checkpoints_timed", - "maxwritten_clean", - } + "buffers_alloc", + "buffers_backend", + "buffers_backend_fsync", + "buffers_checkpoint", + "buffers_clean", + "checkpoints_req", + "checkpoints_timed", + "maxwritten_clean", + } floatMetrics := []string{ "blk_read_time",