Memcached dashing widget to display the number of connected clients to one or more memcached servers, as well as the instance memory usage.
Add it to dashing's gemfile:
gem 'memcached'
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
usage-gauge-background.png
into your/assets/images/
folder - copy
memcached.rb
into your/jobs
folder - copy
memcached.yml
into your/config
folder
Then include the widget in a dashboard, by adding the following snippet to your dashboard layout file:
- For the memcached connected clients count widget:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="memcached_connected_clients" data-view="Number" style="background-color: #3e3735" data-title="Memcached clients"></div>
</li>
- For the memcached memory usage widget:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<style scoped>.memcached_used_memory .gauge { height: 145px;}</style>
<div data-id="memcached_used_memory" data-view="UsageGauge" style="background-color: #3e3735" data-title="Memcached memory"></div>
</li>
You can configure the memcached server address in the /config/memcached.yml file. You can define multiple address depending on the environment:
development: localhost:11211
production: ["localhost:11211", "localhost:11212"]
You can specify the address to a single server, or an array of multiple server, in which case, stats for all servers will be summed.
The environment used is read from ENV['DASHING_ENV']
.