telegraf/plugins/memcached/memcached_test.go

27 lines
531 B
Go
Raw Normal View History

2015-06-22 02:27:46 +00:00
package memcached
import (
"testing"
"github.com/influxdb/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestMemcachedGeneratesMetrics(t *testing.T) {
m := &Memcached{
Servers: []string{"localhost"},
}
var acc testutil.Accumulator
err := m.Gather(&acc)
require.NoError(t, err)
intMetrics := []string{"get_hits", "get_misses", "evictions", "limit_maxbytes", "bytes"}
2015-06-22 02:27:46 +00:00
for _, metric := range intMetrics {
assert.True(t, acc.HasIntValue(metric), metric)
}
}