0.3.0 unit tests: mailchimp, memcached, mongodb

This commit is contained in:
Cameron Sparr
2016-01-06 17:19:39 -07:00
parent 9ada89d51a
commit 6a4bf9fcff
4 changed files with 100 additions and 136 deletions

View File

@@ -141,7 +141,7 @@ func (m *Memcached) gatherServer(
for _, key := range sendMetrics {
if value, ok := values[key]; ok {
// Mostly it is the number
if iValue, errParse := strconv.ParseInt(value, 10, 64); errParse != nil {
if iValue, errParse := strconv.ParseInt(value, 10, 64); errParse == nil {
fields[key] = iValue
} else {
fields[key] = value

View File

@@ -32,7 +32,7 @@ func TestMemcachedGeneratesMetrics(t *testing.T) {
"bytes_read", "bytes_written", "threads", "conn_yields"}
for _, metric := range intMetrics {
assert.True(t, acc.HasIntValue(metric), metric)
assert.True(t, acc.HasIntField("memcached", metric), metric)
}
}