Skip to content

ActiveRRD is a tool for having an AR-ish wrapper around Round Robin Databases.

Notifications You must be signed in to change notification settings

adrianpike/activerrd

Repository files navigation

activerrd

Based upon hard and most appreciated work by: David Bacher <drbacher at alum.mit.edu> Mark Probert <probertm at acm.org>

Miles Egan <miles at caddr.com>

DESCRIPTION:

ActiveRRD is a tool for having an AR-ish wrapper around Round Robin Databases. Someday I might make this shinier, but for now I’m just going to get basic functionality so i can use it.

FEATURES/PROBLEMS:

  • Automagically create RRDs based upon a model-y spec.

  • Update said RRDs

  • Query said RRDs

  • Generate shiny graphs from, once again, said RRDs using RRDtool

TODO:

  • Get good rdoc coverage across it.

  • test test test!

SYNOPSIS:

class FooRrd < Activerrd::Base rrd_key :user_id # :required => false rrd_step 30

rrd_data_source ‘load’, :gauge, :heartbeat=>60, :min=>0, :max=>255 rrd_data_source ‘hits’, :absolute, :heartbeat=>300, :min=>0, :max=>20000 # hits since the last load, since it’s absolute rrd_archive :average, :steps=>100 rrd_archive :max, :steps=>5, :rows=>36, :xff=>0.5 rrd_archive :max, :steps=>50, :rows=>24 end

s = FooRrd.new s.load = 300 s.hits = 20 s.user_id = ‘john smith’ s.save

s = FooRrd.new s.load=12 s.hits=50200 s.created_at=Time.new-2.minutes s.save

FooRrd.find(:average,:start=>Time.new-1.week,:end=>Time.new,:resolution=>5) FooRrd.find(:max,:start=>Time.new-5.minutes)

FooRrd.graph(:start=>Time.new-1.day,:end=>Time.new,:step=>2,:title=>‘Foos’,:vertical_label=>‘Bars’) # this will spit back a File.

REQUIREMENTS:

rubyrrdtool requires RRDtool version 1.2 or later. Some RRD functions such as rrddump are only available with the latest RRDtool.

INSTALL:

Installation is standard. If you’ve installed the gem, you should be ready to go. Otherwise, simply run:

  • ruby extconf.rb

  • make

  • make install

LICENSE:

(The MIT License)

Copyright © 2009 Adrian Pike

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

ActiveRRD is a tool for having an AR-ish wrapper around Round Robin Databases.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published