To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / extra / soundsoftware / get-statistics.rb @ 1545:f81fcbde7eaf
History | View | Annotate | Download (664 Bytes)
| 1 | 970:6bd8364eafae | luis | |
|---|---|---|---|
| 2 | 1453:b554eb79ec7b | luis | # Log user and project information
|
| 3 | #
|
||
| 4 | # Invoke with e.g.
|
||
| 5 | #
|
||
| 6 | # ./script/rails runner -e production extra/soundsoftware/get-statistics.rb
|
||
| 7 | 970:6bd8364eafae | luis | #
|
| 8 | |||
| 9 | 1454:02a05da0bedc | luis | projectStats = {
|
| 10 | :all => Project.active.all.count, |
||
| 11 | :private => Project.active.find(:all, :conditions => {:is_public => false}).count, |
||
| 12 | :top_level => Project.active.find(:all, :conditions => {:parent_id => nil}).count, |
||
| 13 | :top_level_and_private => Project.active.find(:all, :conditions => {:is_public => false, :parent_id => nil}).count |
||
| 14 | } |
||
| 15 | 970:6bd8364eafae | luis | |
| 16 | 1453:b554eb79ec7b | luis | userStats = {:all => User.active.all.count}
|
| 17 | 1002:f6ede18f3e6e | Chris | |
| 18 | 1453:b554eb79ec7b | luis | stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json
|
| 19 | 1002:f6ede18f3e6e | Chris | |
| 20 | 1453:b554eb79ec7b | luis | print "#{stats}\n"
|