Mercurial > hg > soundsoftware-site
annotate extra/soundsoftware/get-statistics.rb @ 1621:3a510bf6a9bc
Merge from live branch
author | Chris Cannam |
---|---|
date | Fri, 13 Jul 2018 10:44:33 +0100 |
parents | 02a05da0bedc |
children |
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@1454 | 9 projectStats = { |
luis@1454 | 10 :all => Project.active.all.count, |
luis@1454 | 11 :private => Project.active.find(:all, :conditions => {:is_public => false}).count, |
luis@1454 | 12 :top_level => Project.active.find(:all, :conditions => {:parent_id => nil}).count, |
luis@1454 | 13 :top_level_and_private => Project.active.find(:all, :conditions => {:is_public => false, :parent_id => nil}).count |
luis@1454 | 14 } |
luis@970 | 15 |
luis@1453 | 16 userStats = {:all => User.active.all.count} |
Chris@1002 | 17 |
luis@1453 | 18 stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json |
Chris@1002 | 19 |
luis@1453 | 20 print "#{stats}\n" |
Chris@1002 | 21 |