Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memcached plugin addtional metrics to collect added #4914

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 32 additions & 17 deletions plugins/inputs/memcached/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,46 @@ The fields from this plugin are gathered in the *memcached* measurement.

Fields:

* get_hits - Number of keys that have been requested and found present
* get_misses - Number of items that have been requested and not found
* evictions - Number of valid items removed from cache to free memory for new items
* limit_maxbytes - Number of bytes this server is allowed to use for storage
* accepting_conns - Whether or not server is accepting conns
* auth_cmds - Number of authentication commands handled, success or failure
* auth_errors - Number of failed authentications
* bytes - Current number of bytes used to store items
* uptime - Number of secs since the server started
* curr_items - Current number of items stored
* total_items - Total number of items stored since the server started
* curr_connections - Number of open connections
* total_connections - Total number of connections opened since the server started running
* connection_structures - Number of connection structures allocated by the server
* bytes_read - Total number of bytes read by this server from network
* bytes_written - Total number of bytes sent by this server to network
* cas_badval - Number of CAS reqs for which a key was found, but the CAS value did not match
* cas_hits - Number of successful CAS reqs
* cas_misses - Number of CAS reqs against missing keys
* cmd_flush - Cumulative number of flush reqs
* cmd_get - Cumulative number of retrieval reqs
* cmd_set - Cumulative number of storage reqs
* cmd_touch - Cumulative number of touch reqs
* conn_yields - Number of times any connection yielded to another due to hitting the -R limit
* connection_structures - Number of connection structures allocated by the server
* curr_connections - Number of open connections
* curr_items - Current number of items stored
* decr_hits - Number of successful decr reqs
* decr_misses - Number of decr reqs against missing keys
* delete_hits - Number of deletion reqs resulting in an item being removed
* delete_misses - umber of deletions reqs for missing keys
* evicted_unfetched - Items evicted from LRU that were never touched by get/incr/append/etc
* evictions - Number of valid items removed from cache to free memory for new items
* expired_unfetched - Items pulled from LRU that were never touched by get/incr/append/etc before expiring
* get_hits - Number of keys that have been requested and found present
* get_misses - Number of items that have been requested and not found
* hash_bytes - Bytes currently used by hash tables
* hash_is_expanding - Indicates if the hash table is being grown to a new size
* hash_power_level - Current size multiplier for hash table
* incr_hits - Number of successful incr reqs
* incr_misses - Number of incr reqs against missing keys
* decr_hits - Number of successful decr reqs
* decr_misses - Number of decr reqs against missing keys
* cas_hits - Number of successful CAS reqs
* cas_misses - Number of CAS reqs against missing keys
* bytes_read - Total number of bytes read by this server from network
* bytes_written - Total number of bytes sent by this server to network
* limit_maxbytes - Number of bytes this server is allowed to use for storage
* listen_disabled_num - Number of times server has stopped accepting new connections (maxconns)
* reclaimed - Number of times an entry was stored using memory from an expired entry
* threads - Number of worker threads requested
* conn_yields - Number of times any connection yielded to another due to hitting the -R limit
* total_connections - Total number of connections opened since the server started running
* total_items - Total number of items stored since the server started
* touch_hits - Number of keys that have been touched with a new expiration time
* touch_misses - Number of items that have been touched and not found
* uptime - Number of secs since the server started

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

Expand Down
49 changes: 32 additions & 17 deletions plugins/inputs/memcached/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,46 @@ var defaultTimeout = 5 * time.Second

// The list of metrics that should be sent
var sendMetrics = []string{
"get_hits",
"get_misses",
"evictions",
"limit_maxbytes",
"accepting_conns",
"auth_cmds",
"auth_errors",
"bytes",
"uptime",
"curr_items",
"total_items",
"curr_connections",
"total_connections",
"connection_structures",
"bytes_read",
"bytes_written",
"cas_badval",
"cas_hits",
"cas_misses",
"cmd_flush",
"cmd_get",
"cmd_set",
"cmd_touch",
"conn_yields",
"connection_structures",
"curr_connections",
"curr_items",
"decr_hits",
"decr_misses",
"delete_hits",
"delete_misses",
"evicted_unfetched",
"evictions",
"expired_unfetched",
"get_hits",
"get_misses",
"hash_bytes",
"hash_is_expanding",
"hash_power_level",
"incr_hits",
"incr_misses",
"decr_hits",
"decr_misses",
"cas_hits",
"cas_misses",
"bytes_read",
"bytes_written",
"limit_maxbytes",
"listen_disabled_num",
"reclaimed",
"threads",
"conn_yields",
"total_connections",
"total_items",
"touch_hits",
"touch_misses",
"uptime",
}

// SampleConfig returns sample configuration message
Expand Down