Skip to content

Instantly share code, notes, and snippets.

View harking's full-sized avatar

George Montana Harkin harking

View GitHub Profile
@harking
harking / _.md
Created September 28, 2012 14:31 — forked from anonymous/_.md
just another inlet to tributary
def by_domain(domain=nil)
by_domains = {}
@stats.each do |bind_group, bg_values|
bg_values.each do |bind, b_values|
b_values.each do |b_domain, stats|
by_domains[b_domain] ||= {:active => 0, :delayed => 0}
by_domains[b_domain][:active] += stats[:active].to_i
by_domains[b_domain][:delayed] += stats[:delayed].to_i
end
end