embulk-input-google_analytics 0.1.14 → 0.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/circle.yml +4 -1
- data/embulk-input-google_analytics.gemspec +1 -1
- data/lib/embulk/input/google_analytics/client.rb +0 -5
- data/lib/embulk/input/google_analytics/plugin.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 038d5260b65f61ec9ecb388cd291ae1cd552f39f
|
4
|
+
data.tar.gz: aa8ff1327f96d146542398c024779396994653f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c8bce9e227b6fd90b3f007a85c20a652a873b7692914672102d2b089566943de8a50d8eaaca45e33be1cc1e4065b67c2ea13baa67c3eda99d406150f8495725
|
7
|
+
data.tar.gz: 2ba7e78c8be3d73e1c7b6a462bd3b6b0f1cf60c1d097cc12e0c02ae3930bed45360a7dd23f3be3c032b675d7cb90c55b80c99e5b2b39c0d3f9d933a212541a47
|
data/CHANGELOG.md
CHANGED
data/circle.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-input-google_analytics"
|
4
|
-
spec.version = "0.1.
|
4
|
+
spec.version = "0.1.15"
|
5
5
|
spec.authors = ["uu59"]
|
6
6
|
spec.summary = "Google Analytics input plugin for Embulk"
|
7
7
|
spec.description = "Loads records from Google Analytics."
|
@@ -30,11 +30,6 @@ module Embulk
|
|
30
30
|
result = get_reports(page_token)
|
31
31
|
report = result.to_h[:reports].first
|
32
32
|
|
33
|
-
unless page_token
|
34
|
-
# display for first request only
|
35
|
-
Embulk.logger.info "Total: #{report[:data][:row_count]} rows. Fetched first response"
|
36
|
-
end
|
37
|
-
|
38
33
|
if !report[:data].has_key?(:rows)
|
39
34
|
Embulk.logger.warn "Result doesn't contain rows."
|
40
35
|
break
|
@@ -101,9 +101,14 @@ module Embulk
|
|
101
101
|
last_record_time = task["last_record_time"] ? Time.parse(task["last_record_time"]) : nil
|
102
102
|
|
103
103
|
latest_time_series = nil
|
104
|
+
skip_counter, total_counter = 0, 0
|
104
105
|
client.each_report_row do |row|
|
105
106
|
time = row[task["time_series"]]
|
106
|
-
|
107
|
+
total_counter += 1
|
108
|
+
if !preview? && last_record_time && time <= last_record_time
|
109
|
+
skip_counter += 1
|
110
|
+
next
|
111
|
+
end
|
107
112
|
|
108
113
|
values = row.values_at(*columns)
|
109
114
|
page_builder.add values
|
@@ -115,6 +120,12 @@ module Embulk
|
|
115
120
|
end
|
116
121
|
page_builder.finish
|
117
122
|
|
123
|
+
Embulk.logger.info "Total: #{total_counter} rows."
|
124
|
+
if skip_counter > 0
|
125
|
+
Embulk.logger.info "#{skip_counter} rows were ignored because the rows' date is " +
|
126
|
+
"before \"last_record_time\": #{last_record_time}."
|
127
|
+
end
|
128
|
+
|
118
129
|
if task["incremental"]
|
119
130
|
calculate_next_times(latest_time_series)
|
120
131
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-google_analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|