Skip to content

Instantly share code, notes, and snippets.

@joshrobb
Forked from jnunemaker/gist:841656
Created February 24, 2011 04:55
Show Gist options
  • Save joshrobb/841781 to your computer and use it in GitHub Desktop.
Save joshrobb/841781 to your computer and use it in GitHub Desktop.
# How we store all time views across the entire system for http://gauge.es.
# All in one document that gets incremented using MongoDB $inc modifier in
# every track. The $inc increments t, year.t, year.month.t, year.month.day.t
# so we get to the day numbers. These are in EST, as we are in EST and these
# stats are just for us. :) Nothing amazing, but thought I would share.
#
# >> pp View.all_time
{
"_id" => "all_time",
"t" => 502352,
"2011" => {
"t" => 502317,
"02" => {
"t" => 502317,
"17" => {"t" => 50921},
"18" => {"t" => 39072},
"19" => {"t" => 30542},
"20" => {"t" => 31225},
"21" => {"t" => 64293},
"22" => {"t" => 107277},
"23" => {"t" => 103836}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment