Skip to content

Instantly share code, notes, and snippets.

@qrush
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qrush/9369942 to your computer and use it in GitHub Desktop.
Save qrush/9369942 to your computer and use it in GitHub Desktop.
RubyGems.org Feb Push Stats
irb(main):004:0> pp Version.where("created_at > ? and created_at < ?", DateTime.parse("01 Feb 2015"), DateTime.parse("01 Mar 2015")).count
11374
=> 11374
406.2142857142857 avg for feb 2015
irb(main):005:0> pp Version.where("created_at > ? and created_at < ?", DateTime.parse("01 Mar 2015"), DateTime.parse("01 Apr 2015")).count
12522
=> 12522
403.93548387096774 avg for mar 2015
> pp Version.where("created_at > ? and created_at < ?", DateTime.parse("01 Feb 2014"), DateTime.parse("01 Mar 2014")).count
(64.7ms) SELECT COUNT(*) FROM "versions" WHERE (created_at > '2014-02-01 00:00:00' and created_at < '2014-03-01 00:00:00')
11062
> pp Version.where("created_at > ? and created_at < ?", DateTime.parse("01 Feb 2014"), DateTime.parse("01 Mar 2014")).count / 28.0
395.07142857142856
irb(main):008:0> pp Version.where("created_at > ? and created_at < ?", DateTime.parse("01 Feb 2014"), DateTime.parse("01 Mar 2014")).group_by { |v| v.created_at.to_date }.map { |d, r| [d, r.size] }.sort
[[Sat, 01 Feb 2014, 212],
[Sun, 02 Feb 2014, 267],
[Mon, 03 Feb 2014, 368],
[Tue, 04 Feb 2014, 463],
[Wed, 05 Feb 2014, 422],
[Thu, 06 Feb 2014, 394],
[Fri, 07 Feb 2014, 419],
[Sat, 08 Feb 2014, 277],
[Sun, 09 Feb 2014, 273],
[Mon, 10 Feb 2014, 409],
[Tue, 11 Feb 2014, 444],
[Wed, 12 Feb 2014, 550],
[Thu, 13 Feb 2014, 475],
[Fri, 14 Feb 2014, 375],
[Sat, 15 Feb 2014, 226],
[Sun, 16 Feb 2014, 334],
[Mon, 17 Feb 2014, 425],
[Tue, 18 Feb 2014, 537],
[Wed, 19 Feb 2014, 449],
[Thu, 20 Feb 2014, 430],
[Fri, 21 Feb 2014, 558],
[Sat, 22 Feb 2014, 255],
[Sun, 23 Feb 2014, 246],
[Mon, 24 Feb 2014, 457],
[Tue, 25 Feb 2014, 493],
[Wed, 26 Feb 2014, 450],
[Thu, 27 Feb 2014, 443],
[Fri, 28 Feb 2014, 411]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment