To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / extra / soundsoftware / get-statistics.rb @ 1544:e9e55585ebf2

History | View | Annotate | Download (664 Bytes)

1

    
2
# Log user and project information
3
#
4
# Invoke with e.g.
5
#
6
# ./script/rails runner -e production extra/soundsoftware/get-statistics.rb
7
#
8

    
9
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

    
16
userStats = {:all => User.active.all.count}
17

    
18
stats = {:date => Date.today, :projects => projectStats, :users => userStats}.to_json
19

    
20
print "#{stats}\n"
21