Fix postgres plugin with testing ok with fmt
This commit is contained in:
parent
0f5a419a45
commit
e2ef160d5f
|
@ -4,8 +4,8 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/influxdata/telegraf"
|
"github.com/influxdata/telegraf"
|
||||||
"github.com/influxdata/telegraf/plugins/inputs"
|
"github.com/influxdata/telegraf/plugins/inputs"
|
||||||
|
@ -17,7 +17,7 @@ type Postgresql struct {
|
||||||
Address string
|
Address string
|
||||||
Databases []string
|
Databases []string
|
||||||
OrderedColumns []string
|
OrderedColumns []string
|
||||||
AllColumns []string
|
AllColumns []string
|
||||||
}
|
}
|
||||||
|
|
||||||
var ignoredColumns = map[string]bool{"datid": true, "datname": true, "stats_reset": true}
|
var ignoredColumns = map[string]bool{"datid": true, "datname": true, "stats_reset": true}
|
||||||
|
|
|
@ -23,7 +23,7 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) {
|
||||||
var acc testutil.Accumulator
|
var acc testutil.Accumulator
|
||||||
err := p.Gather(&acc)
|
err := p.Gather(&acc)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
availableColumns := make(map[string]bool)
|
availableColumns := make(map[string]bool)
|
||||||
for _, col := range p.AllColumns {
|
for _, col := range p.AllColumns {
|
||||||
availableColumns[col] = true
|
availableColumns[col] = true
|
||||||
|
@ -43,15 +43,15 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) {
|
||||||
"temp_bytes",
|
"temp_bytes",
|
||||||
"deadlocks",
|
"deadlocks",
|
||||||
"numbackends",
|
"numbackends",
|
||||||
"buffers_alloc",
|
"buffers_alloc",
|
||||||
"buffers_backend",
|
"buffers_backend",
|
||||||
"buffers_backend_fsync",
|
"buffers_backend_fsync",
|
||||||
"buffers_checkpoint",
|
"buffers_checkpoint",
|
||||||
"buffers_clean",
|
"buffers_clean",
|
||||||
"checkpoints_req",
|
"checkpoints_req",
|
||||||
"checkpoints_timed",
|
"checkpoints_timed",
|
||||||
"maxwritten_clean",
|
"maxwritten_clean",
|
||||||
}
|
}
|
||||||
|
|
||||||
floatMetrics := []string{
|
floatMetrics := []string{
|
||||||
"blk_read_time",
|
"blk_read_time",
|
||||||
|
|
Loading…
Reference in New Issue