Project

stats

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
The stats gem is a simple way to keep track of different statistics using Redis.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

Stats

Requires the redis gem.

Easily keep track of vital stats using Redis.

Usage

There are currently three types of statistics that Stats captures:

1. Simple

Simple stats are meant to be updated periodically. Only the latest value is kept.

Stats.set("load", System.load)

2. Counts

Counts can be incremented and decremented. Only the latest value is kept.

Stats.incr("downloads")

3. Timings

Timings are used to keep track of the time it takes to run a block. All values are kept so that they can be graphed/analyzed.

Stats.time("archive") { file.archive }

Redis

By default, the Redis server at redis://127.0.0.1:6379/0 will be used. You can set it by either specifying a url or a Redis instance.

Stats.redis = "redis://127.0.0.1:6379/0"

Stats.redis = redis_instance

The current Redis instance can also be accessed.

puts Stats.redis.info

Installation

$ gem install stats

Author

Matt Duncan | mattduncan.org | matt@mattduncan.org