Skip to content

Commit

Permalink
Adding all memcached stats that return a single value
Browse files Browse the repository at this point in the history
  • Loading branch information
Mischa Gresser authored and sparrc committed Dec 2, 2015
1 parent 4b3b41f commit 3509713
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
21 changes: 21 additions & 0 deletions plugins/memcached/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ var sendAsIs = []string{
"evictions",
"limit_maxbytes",
"bytes",
"uptime",
"curr_items",
"total_items",
"curr_connections",
"total_connections",
"connection_structures",
"cmd_get",
"cmd_set",
"delete_hits",
"delete_misses",
"incr_hits",
"incr_misses",
"decr_hits",
"decr_misses",
"cas_hits",
"cas_misses",
"evictions",
"bytes_read",
"bytes_written",
"threads",
"conn_yields",
}

// SampleConfig returns sample configuration message
Expand Down
7 changes: 6 additions & 1 deletion plugins/memcached/memcached_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ func TestMemcachedGeneratesMetrics(t *testing.T) {
err := m.Gather(&acc)
require.NoError(t, err)

intMetrics := []string{"get_hits", "get_misses", "evictions", "limit_maxbytes", "bytes"}
intMetrics := []string{"get_hits", "get_misses", "evictions",
"limit_maxbytes", "bytes", "uptime", "curr_items", "total_items",
"curr_connections", "total_connections", "connection_structures", "cmd_get",
"cmd_set", "delete_hits", "delete_misses", "incr_hits", "incr_misses",
"decr_hits", "decr_misses", "cas_hits", "cas_misses", "evictions",
"bytes_read", "bytes_written", "threads", "conn_yields"}

for _, metric := range intMetrics {
assert.True(t, acc.HasIntValue(metric), metric)
Expand Down

0 comments on commit 3509713

Please sign in to comment.