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",