Redis dashing widget to display the number of connected clients to a redis server, as well as the instance memory usage.
Add it to dashing's gemfile:
gem 'redis'
and run bundle install
.
To use this widget:
- copy
usage_gauge.coffee
,usage_gauge.coffee.html
andusage_gauge.coffee.scss
into the/widgets/usage_gauge
folder - copy
redis.rb
into your/jobs
folder - copy
redis.yml
into your/config
folder - copy
usage-gauge-background.png
into your/assets/images/
folder
Then include the widget in a dashboard, by adding the following snippet to your dashboard layout file:
- For the Redis clients widget:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="redis_connected_clients" data-view="Number" style="background-color: #6C3039" data-title="Redis clients"></div>
</li>
- For the redis memory usage widget:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="redis_used_memory" data-view="UsageGauge" data-title="Redis memory"></div>
<li>
You can configure the redis server address in the /config/redis.yml file. You can define multiple address depending on the environment:
development: localhost:6379
production: /tmp/redis.sock
The environment used is read from ENV['DASHING_ENV']
.
For the memory usage widget, 100% usage means that your redis instance is using all the memory allocated to the redis server, defined by the maxmemory
setting in redis.conf. If you didn't set a limit, the peak memory usage will be used as the maximum.