Skip to content

Commit 49aaec0

Browse files
leonoffotherpirate
authored andcommitted
Collect additional stats in memcached input (influxdata#4914)
1 parent 0634e85 commit 49aaec0

File tree

2 files changed

+64
-34
lines changed

2 files changed

+64
-34
lines changed

plugins/inputs/memcached/README.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,46 @@ The fields from this plugin are gathered in the *memcached* measurement.
2020

2121
Fields:
2222

23-
* get_hits - Number of keys that have been requested and found present
24-
* get_misses - Number of items that have been requested and not found
25-
* evictions - Number of valid items removed from cache to free memory for new items
26-
* limit_maxbytes - Number of bytes this server is allowed to use for storage
23+
* accepting_conns - Whether or not server is accepting conns
24+
* auth_cmds - Number of authentication commands handled, success or failure
25+
* auth_errors - Number of failed authentications
2726
* bytes - Current number of bytes used to store items
28-
* uptime - Number of secs since the server started
29-
* curr_items - Current number of items stored
30-
* total_items - Total number of items stored since the server started
31-
* curr_connections - Number of open connections
32-
* total_connections - Total number of connections opened since the server started running
33-
* connection_structures - Number of connection structures allocated by the server
27+
* bytes_read - Total number of bytes read by this server from network
28+
* bytes_written - Total number of bytes sent by this server to network
29+
* cas_badval - Number of CAS reqs for which a key was found, but the CAS value did not match
30+
* cas_hits - Number of successful CAS reqs
31+
* cas_misses - Number of CAS reqs against missing keys
32+
* cmd_flush - Cumulative number of flush reqs
3433
* cmd_get - Cumulative number of retrieval reqs
3534
* cmd_set - Cumulative number of storage reqs
35+
* cmd_touch - Cumulative number of touch reqs
36+
* conn_yields - Number of times any connection yielded to another due to hitting the -R limit
37+
* connection_structures - Number of connection structures allocated by the server
38+
* curr_connections - Number of open connections
39+
* curr_items - Current number of items stored
40+
* decr_hits - Number of successful decr reqs
41+
* decr_misses - Number of decr reqs against missing keys
3642
* delete_hits - Number of deletion reqs resulting in an item being removed
3743
* delete_misses - umber of deletions reqs for missing keys
44+
* evicted_unfetched - Items evicted from LRU that were never touched by get/incr/append/etc
45+
* evictions - Number of valid items removed from cache to free memory for new items
46+
* expired_unfetched - Items pulled from LRU that were never touched by get/incr/append/etc before expiring
47+
* get_hits - Number of keys that have been requested and found present
48+
* get_misses - Number of items that have been requested and not found
49+
* hash_bytes - Bytes currently used by hash tables
50+
* hash_is_expanding - Indicates if the hash table is being grown to a new size
51+
* hash_power_level - Current size multiplier for hash table
3852
* incr_hits - Number of successful incr reqs
3953
* incr_misses - Number of incr reqs against missing keys
40-
* decr_hits - Number of successful decr reqs
41-
* decr_misses - Number of decr reqs against missing keys
42-
* cas_hits - Number of successful CAS reqs
43-
* cas_misses - Number of CAS reqs against missing keys
44-
* bytes_read - Total number of bytes read by this server from network
45-
* bytes_written - Total number of bytes sent by this server to network
54+
* limit_maxbytes - Number of bytes this server is allowed to use for storage
55+
* listen_disabled_num - Number of times server has stopped accepting new connections (maxconns)
56+
* reclaimed - Number of times an entry was stored using memory from an expired entry
4657
* threads - Number of worker threads requested
47-
* conn_yields - Number of times any connection yielded to another due to hitting the -R limit
58+
* total_connections - Total number of connections opened since the server started running
59+
* total_items - Total number of items stored since the server started
60+
* touch_hits - Number of keys that have been touched with a new expiration time
61+
* touch_misses - Number of items that have been touched and not found
62+
* uptime - Number of secs since the server started
4863

4964
Description of gathered fields taken from [here](https://github.com/memcached/memcached/blob/master/doc/protocol.txt).
5065

plugins/inputs/memcached/memcached.go

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,46 @@ var defaultTimeout = 5 * time.Second
2929

3030
// The list of metrics that should be sent
3131
var sendMetrics = []string{
32-
"get_hits",
33-
"get_misses",
34-
"evictions",
35-
"limit_maxbytes",
32+
"accepting_conns",
33+
"auth_cmds",
34+
"auth_errors",
3635
"bytes",
37-
"uptime",
38-
"curr_items",
39-
"total_items",
40-
"curr_connections",
41-
"total_connections",
42-
"connection_structures",
36+
"bytes_read",
37+
"bytes_written",
38+
"cas_badval",
39+
"cas_hits",
40+
"cas_misses",
41+
"cmd_flush",
4342
"cmd_get",
4443
"cmd_set",
44+
"cmd_touch",
45+
"conn_yields",
46+
"connection_structures",
47+
"curr_connections",
48+
"curr_items",
49+
"decr_hits",
50+
"decr_misses",
4551
"delete_hits",
4652
"delete_misses",
53+
"evicted_unfetched",
54+
"evictions",
55+
"expired_unfetched",
56+
"get_hits",
57+
"get_misses",
58+
"hash_bytes",
59+
"hash_is_expanding",
60+
"hash_power_level",
4761
"incr_hits",
4862
"incr_misses",
49-
"decr_hits",
50-
"decr_misses",
51-
"cas_hits",
52-
"cas_misses",
53-
"bytes_read",
54-
"bytes_written",
63+
"limit_maxbytes",
64+
"listen_disabled_num",
65+
"reclaimed",
5566
"threads",
56-
"conn_yields",
67+
"total_connections",
68+
"total_items",
69+
"touch_hits",
70+
"touch_misses",
71+
"uptime",
5772
}
5873

5974
// SampleConfig returns sample configuration message

0 commit comments

Comments
 (0)