Fix postgres plugin with testing ok with fmt

This commit is contained in:
Thomas Menard 2016-02-12 15:00:49 +01:00
parent 0f5a419a45
commit e2ef160d5f
2 changed files with 12 additions and 12 deletions

View File

@ -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}

View File

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