# Monitor your server with 3 lines of Ruby

**URL:** <https://www.ruby-forum.com/t/monitor-your-server-with-3-lines-of-ruby/147694>\
**Category:** Rails\
**Created:** [September 4, 2008, 9:34am UTC](https://www.ruby-forum.com/t/monitor-your-server-with-3-lines-of-ruby/147694 "2008-09-04T09:34:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fjan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6de8d8/32.png) [@fjan](https://www.ruby-forum.com/u/fjan)\
**Post date:** [September 4, 2008, 9:34am UTC](https://www.ruby-forum.com/t/monitor-your-server-with-3-lines-of-ruby/147694/1 "2008-09-04T09:34:36Z")

</div>

I thought I’d share this snippet, it simply draws a bar chart of the  
visitors to your site in the last 24 hours. Great as a poor man’s  
solution to monitoring server load.

What is cool is that it does this in 3 lines of RoR and without using  
any plugins (it uses Google’s free chart API to do the heavy lifting).  
So just add this to one of your admin pages and you’re off

[http://pastie.org/265792](http://pastie.org/265792)

ps. I’m not looking for any prizes on coding clarity; but it’s just  
awesome you can do something like this in such a tiny snippet
