Mercurial > hg > soundsoftware-site
annotate extra/soundsoftware/get-statistics.rb @ 1453:b554eb79ec7b luisf
Moved previous script to different project (https://code.soundsoftware.ac.uk/hg/codesoundsoftware-stats); created a simpler to log site stats.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 07 Nov 2013 17:03:33 +0000 |
parents | f6ede18f3e6e |
children | 02a05da0bedc |
rev | line source |
---|---|
luis@970 | 1 |
luis@1453 | 2 # Log user and project information |
luis@1453 | 3 # |
luis@1453 | 4 # Invoke with e.g. |
luis@1453 | 5 # |
luis@1453 | 6 # ./script/rails runner -e production extra/soundsoftware/get-statistics.rb |
luis@970 | 7 # |
luis@970 | 8 |
luis@1453 | 9 projectStats = {:all => Project.active.all.count, :private => Project.active.find(:all, :conditions => {:is_public => false}).count} |
luis@970 | 10 |
luis@1453 | 11 userStats = {:all => User.active.all.count} |
Chris@1002 | 12 |
luis@1453 | 13 stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json |
Chris@1002 | 14 |
luis@1453 | 15 print "#{stats}\n" |
Chris@1002 | 16 |