module Analytics

Constants

DB

connect to mysql

Public Class Methods

client() click to toggle source
# File lib/analytics.rb, line 18
def self.client
    @client
end
close() click to toggle source
# File lib/analytics.rb, line 14
def self.close
    @stmt.close
    @client.close
end
gather_day_visitor() click to toggle source

gather day visitor data

# File lib/analytics.rb, line 25
def self.gather_day_visitor
    Util.gather_data{|site_id|
        gatherer = FetchMainGatherData.new(site_id)
        gatherer.gatherDayVisitor
    }
end
gather_dic_visitor(gather_table,column_name) click to toggle source

gather visitor data using dictionary group

# File lib/analytics.rb, line 39
def self.gather_dic_visitor gather_table,column_name
    Util.gather_data{|site_id|
        gatherer = FetchMainGatherData.new(site_id)
        gatherer.gatherDicDayVisitor gather_table,column_name
    }
end
gather_hour_visitor() click to toggle source

gather hour visitor data

# File lib/analytics.rb, line 32
def self.gather_hour_visitor
    Util.gather_data{|site_id|
        gatherer = FetchMainGatherData.new(site_id)
        gatherer.gatherHourVisitor
    }
end
init() click to toggle source
# File lib/analytics.rb, line 9
def self.init
    @client=Mysql.new("localhost", "root",nil,DB,nil,'/tmp/mysql.sock')
    @client.autocommit(true)
    @stmt = @client.stmt_init
end
stmt() click to toggle source
# File lib/analytics.rb, line 21
def self.stmt
    @stmt
end