class Graphiti::Stats::DSL

Provides an easier interface to stats scoping.

Used within Resource DSL:

allow_stat total: [:count] do
  # ... eval'd in Stats::DSL context! ...
end

This allows us to define arbitrary stats:

allow_stat total: [:count] do
  standard_deviation { |scope, attr| ... }
end

And use convenience methods:

allow_stat :rating do
  count!
  average!
end

@see Resource.allow_stat @attr_reader [Symbol] name the stat, e.g. :total @attr_reader [Hash] calculations procs for various metrics