analytics 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/analytics.gemspec +1 -1
  3. data/lib/analytics.rb +3 -3
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{analytics}
8
- s.version = "0.1.6"
8
+ s.version = "0.1.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jun Tsai"]
@@ -86,7 +86,7 @@ module Analytics
86
86
  now,yesterday_start,yesterday_end = Util.day_query_time
87
87
  pv = @client.query("select count(id) from visitors where site_id=#{@site_id} and created_at > #{yesterday_start} and created_at < #{yesterday_end}").fetch_row[0]
88
88
  ipv = @client.query("select count(distinct ip_id) from visitors where site_id=#{@site_id} and created_at > #{yesterday_start} and created_at < #{yesterday_end}").fetch_row[0]
89
- r = @client.query("select count(id) from site_day_gather where site_id=#{@site_id} and day_time=#{yesterday_start}").fetch_row[0]
89
+ r = @client.query("select count(id) from site_day_gather where site_id=#{@site_id} and day_time=#{yesterday_start}").fetch_row[0].to_i
90
90
  if(r == 0)
91
91
  @stmt.prepare("insert into site_day_gather(site_id,pv,ipv,day_time,created_at) "+
92
92
  " values(?,?,?,?,?)" )
@@ -102,7 +102,7 @@ module Analytics
102
102
  pv = @client.query("select count(id) from visitors where site_id=#{@site_id} and created_at >= #{last_hour_start} and created_at <= #{last_hour_end}").fetch_row[0]
103
103
  ipv = @client.query("select count(distinct ip_id) from visitors where site_id=#{@site_id} and created_at >= #{last_hour_start} and created_at <= #{last_hour_end}").fetch_row[0]
104
104
 
105
- r = @client.query("select count(id) from site_hour_gather where site_id=#{@site_id} and hour_time=#{last_hour_start}").fetch_row[0]
105
+ r = @client.query("select count(id) from site_hour_gather where site_id=#{@site_id} and hour_time=#{last_hour_start}").fetch_row[0].to_i
106
106
  if(r == 0)
107
107
  @stmt.prepare("insert into site_hour_gather(site_id,pv,ipv,hour_time,created_at) "+
108
108
  " values(?,?,?,?,?)" )
@@ -121,7 +121,7 @@ module Analytics
121
121
  @client.query("select count(id),#{col} from visitors where site_id=#{@site_id} and created_at > #{yesterday_start} and created_at < #{yesterday_end} group by #{col}").each{|row|
122
122
 
123
123
 
124
- r = @client.query("select count(id) from #{gather_table} where site_id=#{@site_id} and day_time=#{yesterday_start} and #{col}=#{row[1]}").fetch_row[0]
124
+ r = @client.query("select count(id) from #{gather_table} where site_id=#{@site_id} and day_time=#{yesterday_start} and #{col}=#{row[1]}").fetch_row[0].to_i
125
125
  if(r == 0 )
126
126
  @stmt.prepare("insert into #{gather_table}(site_id,pv,day_time,created_at,#{col}) "+
127
127
  " values(?,?,?,?,?)" )
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analytics
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jun Tsai