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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50dbb45a40d2ba30337b53953a09d03e18ab852a
4
- data.tar.gz: 128c122ef03e9af445dfdde8b4d52a467a940881
3
+ metadata.gz: 038d5260b65f61ec9ecb388cd291ae1cd552f39f
4
+ data.tar.gz: aa8ff1327f96d146542398c024779396994653f4
5
5
  SHA512:
6
- metadata.gz: 190ed6b59331eff1d4de19e541e7d2e334f8829b03c2710046ea2dae811a8fda1f394a14c16533a5c2982f414361f9ed36cfbac18221b5047a0e5f2c98a3e285
7
- data.tar.gz: 94eae01d0980ec8f91b328daaa4a681287489b81db31313b5dfc5c7e4aa3ae569c68a0aeda7a171b30af496df90f645d752c9a32d768afe9226b7045ebb7241d
6
+ metadata.gz: 7c8bce9e227b6fd90b3f007a85c20a652a873b7692914672102d2b089566943de8a50d8eaaca45e33be1cc1e4065b67c2ea13baa67c3eda99d406150f8495725
7
+ data.tar.gz: 2ba7e78c8be3d73e1c7b6a462bd3b6b0f1cf60c1d097cc12e0c02ae3930bed45360a7dd23f3be3c032b675d7cb90c55b80c99e5b2b39c0d3f9d933a212541a47
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.15 - 2017-11-29
2
+
3
+ * Add explicit logging for the number of skipped records
4
+
1
5
  ## 0.1.14 - 2017-06-27
2
6
 
3
7
  * Fixed version of google-api-client [#26](https://github.com/treasure-data/embulk-input-google_analytics/pull/26)
data/circle.yml CHANGED
@@ -16,7 +16,10 @@ dependencies:
16
16
  test:
17
17
  override:
18
18
  - bundle exec rake cov
19
-
19
+ notify:
20
+ webhooks:
21
+ - url: http://td-beda.herokuapp.com/circleci_callback
22
+
20
23
  general:
21
24
  artifacts:
22
25
  - "coverage"
@@ -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.14"
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
- next if !preview? && last_record_time && time <= last_record_time
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.14
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-06-27 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient