Merge branch 'master' of https://github.com/influxdb/telegraf into lustre2-plugin
Conflicts: testutil/accumulator.go
This commit is contained in:
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
func TestReadsMetricsFromKafka(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
}
|
||||
var zkPeers, brokerPeers []string
|
||||
|
||||
if len(os.Getenv("ZOOKEEPER_PEERS")) == 0 {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func TestMemcachedGeneratesMetrics(t *testing.T) {
|
||||
m := &Memcached{
|
||||
Servers: []string{"localhost"},
|
||||
Servers: []string{testutil.GetLocalHost()},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
@@ -457,7 +457,7 @@ func NewStatLine(oldStat, newStat ServerStatus, key string, all bool, sampleSecs
|
||||
oldStat.ExtraInfo.PageFaults != nil && newStat.ExtraInfo.PageFaults != nil {
|
||||
returnVal.Faults = diff(*(newStat.ExtraInfo.PageFaults), *(oldStat.ExtraInfo.PageFaults), sampleSecs)
|
||||
}
|
||||
if !returnVal.IsMongos && oldStat.Locks != nil && oldStat.Locks != nil {
|
||||
if !returnVal.IsMongos && oldStat.Locks != nil {
|
||||
globalCheck, hasGlobal := oldStat.Locks["Global"]
|
||||
if hasGlobal && globalCheck.AcquireCount != nil {
|
||||
// This appears to be a 3.0+ server so the data in these fields do *not* refer to
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mysql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
|
||||
func TestMysqlGeneratesMetrics(t *testing.T) {
|
||||
m := &Mysql{
|
||||
Servers: []string{""},
|
||||
Servers: []string{fmt.Sprintf("root@tcp(%s:3306)/", testutil.GetLocalHost())},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
@@ -53,7 +54,9 @@ func TestMysqlGeneratesMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMysqlDefaultsToLocal(t *testing.T) {
|
||||
m := &Mysql{}
|
||||
m := &Mysql{
|
||||
Servers: []string{fmt.Sprintf("root@tcp(%s:3306)/", testutil.GetLocalHost())},
|
||||
}
|
||||
|
||||
var acc testutil.Accumulator
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package postgresql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdb/telegraf/testutil"
|
||||
@@ -12,7 +13,7 @@ func TestPostgresqlGeneratesMetrics(t *testing.T) {
|
||||
p := &Postgresql{
|
||||
Servers: []*Server{
|
||||
{
|
||||
Address: "sslmode=disable",
|
||||
Address: fmt.Sprintf("host=%s user=postgres sslmode=disable", testutil.GetLocalHost()),
|
||||
Databases: []string{"postgres"},
|
||||
},
|
||||
},
|
||||
@@ -57,7 +58,7 @@ func TestPostgresqlTagsMetricsWithDatabaseName(t *testing.T) {
|
||||
p := &Postgresql{
|
||||
Servers: []*Server{
|
||||
{
|
||||
Address: "sslmode=disable",
|
||||
Address: fmt.Sprintf("host=%s user=postgres sslmode=disable", testutil.GetLocalHost()),
|
||||
Databases: []string{"postgres"},
|
||||
},
|
||||
},
|
||||
@@ -78,7 +79,7 @@ func TestPostgresqlDefaultsToAllDatabases(t *testing.T) {
|
||||
p := &Postgresql{
|
||||
Servers: []*Server{
|
||||
{
|
||||
Address: "sslmode=disable",
|
||||
Address: fmt.Sprintf("host=%s user=postgres sslmode=disable", testutil.GetLocalHost()),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func TestRedisGeneratesMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkInt {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
|
||||
checkFloat := []struct {
|
||||
@@ -98,7 +98,7 @@ func TestRedisGeneratesMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkFloat {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ func TestRedisCanPullStatsFromMultipleServers(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkInt {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
|
||||
checkFloat := []struct {
|
||||
@@ -189,7 +189,7 @@ func TestRedisCanPullStatsFromMultipleServers(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, c := range checkFloat {
|
||||
assert.NoError(t, acc.ValidateValue(c.name, c.value))
|
||||
assert.True(t, acc.CheckValue(c.name, c.value))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ func (s *Server) addClusterStats(acc plugins.Accumulator) error {
|
||||
defer cursor.Close()
|
||||
var clusterStats stats
|
||||
if err := cursor.One(&clusterStats); err != nil {
|
||||
return fmt.Errorf("failure to parse cluster stats, $s\n", err.Error())
|
||||
return fmt.Errorf("failure to parse cluster stats, %s\n", err.Error())
|
||||
}
|
||||
|
||||
tags := s.getDefaultTags()
|
||||
@@ -146,7 +146,7 @@ func (s *Server) addMemberStats(acc plugins.Accumulator) error {
|
||||
defer cursor.Close()
|
||||
var memberStats stats
|
||||
if err := cursor.One(&memberStats); err != nil {
|
||||
return fmt.Errorf("failure to parse member stats, $s\n", err.Error())
|
||||
return fmt.Errorf("failure to parse member stats, %s\n", err.Error())
|
||||
}
|
||||
|
||||
tags := s.getDefaultTags()
|
||||
|
||||
@@ -45,7 +45,7 @@ func TestDisk_io_counters(t *testing.T) {
|
||||
t.Errorf("error %v", err)
|
||||
}
|
||||
if len(ret) == 0 {
|
||||
t.Errorf("ret is empty", ret)
|
||||
t.Errorf("ret is empty: %s", ret)
|
||||
}
|
||||
empty := DiskIOCountersStat{}
|
||||
for part, io := range ret {
|
||||
|
||||
Reference in New Issue
Block a user