Module: Analytics
- Defined in:
- lib/analytics.rb
Defined Under Namespace
Classes: FetchMainGatherData, Util
Constant Summary collapse
- DB =
connect to mysql
'analytics'
Class Method Summary collapse
- .client ⇒ Object
- .close ⇒ Object
-
.gather_day_visitor ⇒ Object
gather day visitor data.
-
.gather_dic_visitor(gather_table, column_name) ⇒ Object
gather visitor data using dictionary group.
-
.gather_hour_visitor ⇒ Object
gather hour visitor data.
- .init ⇒ Object
- .stmt ⇒ Object
Class Method Details
.client ⇒ Object
18 19 20 |
# File 'lib/analytics.rb', line 18 def self.client @client end |
.close ⇒ Object
14 15 16 17 |
# File 'lib/analytics.rb', line 14 def self.close @stmt.close @client.close end |
.gather_day_visitor ⇒ Object
gather day visitor data
25 26 27 28 29 30 |
# 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) ⇒ Object
gather visitor data using dictionary group
39 40 41 42 43 44 |
# 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 ⇒ Object
gather hour visitor data
32 33 34 35 36 37 |
# 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 ⇒ Object
9 10 11 12 13 |
# 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 ⇒ Object
21 22 23 |
# File 'lib/analytics.rb', line 21 def self.stmt @stmt end |