Class | MetricsPack
In: | lib/stella/core_ext.rb
Parent: | Storable

A simple class for really fast serialized timing data. NOTE: We‘re storing the serialized data directly to a redis sorted set so it‘s important that each chunk of data in unique. Also, it‘s possible to grab the stamp from the zrange using :with_scores. NOTE2: We bypass Storable‘s to_csv and from_csv for speed. TODO: test speed difference.

### Methods

from_csv from_json kind metric? new pack quantize_stamp to_a to_csv to_s unpack update

### Constants

METRICS | = | [:rt, :sc, :sr, :fb, :lb, :rscs, :rshs, :rqcs, :rqhs]
TALLIES | = | [:n, :errors]

### Public Class methods

from_csv(str)
from_json(str)
metric?(guess)
new(stamp=nil, uid=nil, n=nil)
unpack(str)

### Public Instance methods

kind()
pack()
quantize_stamp(quantum)

@stamp => 1281355304 (2010-08-09-12-01-44) quantize_stamp(1.day) => 1281312000 (2010-08-09) quantize_stamp(1.hour) => 1281355200 (2010-08-09-12) quantize_stamp(1.minute) => 1281355260 (2010-08-09-12-01)

to_a()
to_csv()
to_s()
update(*args)

should be in the same order as the fields are defined (i.e. MetricsPack.field_names)

[Validate]