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 @ 1453:b554eb79ec7b
History | View | Annotate | Download (425 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 | 1453:b554eb79ec7b | luis | projectStats = {:all => Project.active.all.count, :private => Project.active.find(:all, :conditions => {:is_public => false}).count}
|
| 10 | 970:6bd8364eafae | luis | |
| 11 | 1453:b554eb79ec7b | luis | userStats = {:all => User.active.all.count}
|
| 12 | 1002:f6ede18f3e6e | Chris | |
| 13 | 1453:b554eb79ec7b | luis | stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json
|
| 14 | 1002:f6ede18f3e6e | Chris | |
| 15 | 1453:b554eb79ec7b | luis | print "#{stats}\n"
|