Skip to content
This repository has been archived by the owner on Apr 14, 2018. It is now read-only.

mrduncan/stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple stats collection using Redis. UNMAINTAINED

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages