Cache Metrics
Metrician can automatically report metrics about calls your application makes to the common caches redis and memcached if you are using the redis gem, or one of memcached gem or dalli gem, respectively. If you need metrics about the service itself, rather than your application's interaction with it, then check out instrumentald.
Configuration
Metrician accepts 2 configuration options for cache metric collection in metrician.yaml
. Cache metrics are enabled by default. For each call to memcached or redis, Metrician can be configured to also report the command used (e.g. GET/SET
for memcached, HGET/ZRANK/MGET
for redis) as part of the metric. The following are the default settings.
:cache: :enabled: true :command: :enabled: true :command_specific: :enabled: false
Metrics
app.cache.command |
average query execution time (ms) |
---|---|
app.cache.command.<command_name> |
avg. query execution time (ms) by command |
Cache Metrics Query Language Expressions
To get the raw count of commands your application is sending to your cache service, add the following expression to a graph:
gauge_count(app.cache.command)
If you have enabled command_specific
metrics and are using Memcached, determine your read-write ratio with this expression:
gauge_count(app.cache.command.get) / gauge_count(app.cache.command.set)