analytics 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/analytics.gemspec +2 -2
- data/lib/analytics.rb +2 -2
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.3
|
data/analytics.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{analytics}
|
|
8
|
-
s.version = "0.1.
|
|
8
|
+
s.version = "0.1.3"
|
|
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"]
|
|
12
|
-
s.date = %q{2011-02-
|
|
12
|
+
s.date = %q{2011-02-24}
|
|
13
13
|
s.description = %q{Analytics System}
|
|
14
14
|
s.email = %q{jcai@fepss.com}
|
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/analytics.rb
CHANGED
|
@@ -69,7 +69,7 @@ module Analytics
|
|
|
69
69
|
def gatherDayVisitor
|
|
70
70
|
now,yesterday_start,yesterday_end = Util.day_query_time
|
|
71
71
|
pv = @client.query("select count(id) from visitors where site_id=#{@site_id} and created_at > #{yesterday_start} and created_at < #{yesterday_end}",:as=>:array).first.first
|
|
72
|
-
ipv = @client.query("select count(distinct
|
|
72
|
+
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}").first.first
|
|
73
73
|
@client.query("insert into site_day_gather(site_id,pv,ipv,day_time,created_at)
|
|
74
74
|
values( #{@site_id},
|
|
75
75
|
#{pv},
|
|
@@ -81,7 +81,7 @@ module Analytics
|
|
|
81
81
|
def gatherHourVisitor
|
|
82
82
|
now,last_hour_start,last_hour_end = Util.hour_query_time
|
|
83
83
|
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}",:as=>:array).first.first
|
|
84
|
-
ipv = @client.query("select count(distinct
|
|
84
|
+
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}").first.first
|
|
85
85
|
@client.query("insert into site_hour_gather(site_id,pv,ipv,hour_time,created_at) " +
|
|
86
86
|
"values( #{@site_id},
|
|
87
87
|
#{pv},
|
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:
|
|
4
|
+
hash: 29
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.1.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jun Tsai
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-02-
|
|
18
|
+
date: 2011-02-24 00:00:00 +08:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|