triglav-agent-bigquery 1.0.0.rc3 → 1.0.0
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7a186de9c6e0067a4d126a34bdc385d9530bd7a
|
4
|
+
data.tar.gz: 49a92bd870852241ee0bc1baab990c7129482cdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28fe97ff1a8b026615961347cb357c6e5622dbd8ea5fcb1bf61671fb61d2ab04b80b67e0461b9b45cd05b42649adf5d8fb346e7ddf5133f038d02add1e9901b9
|
7
|
+
data.tar.gz: b75ba41d1bdc5cc6d3e8fda6628336456d43b12b1335533e1377db4bf2b56730afedc27c3148c2aa55a70fef3f282c287e0ace7cb7b251cef73064bcc91b13bc
|
data/CHANGELOG.md
CHANGED
data/example/config.yml
CHANGED
@@ -17,7 +17,8 @@ defaults: &defaults
|
|
17
17
|
bigquery:
|
18
18
|
monitor_interval: 5
|
19
19
|
retries: 5
|
20
|
-
|
20
|
+
send_timeout_sec: 60
|
21
|
+
read_timeout_sec: 300
|
21
22
|
open_timeout_sec: 300
|
22
23
|
connection_info:
|
23
24
|
"https://bigquery.cloud.google.com/table/<%= ENV['GOOGLE_PROJECT'] || 'your-project' %>":
|
@@ -59,8 +59,13 @@ module Triglav::Agent
|
|
59
59
|
|
60
60
|
client = Google::Apis::BigqueryV2::BigqueryService.new
|
61
61
|
client.request_options.retries = retries
|
62
|
-
client.
|
63
|
-
client.
|
62
|
+
client.client_options.send_timeout_sec = send_timeout_sec
|
63
|
+
client.client_options.read_timeout_sec = read_timeout_sec
|
64
|
+
client.client_options.open_timeout_sec = open_timeout_sec
|
65
|
+
|
66
|
+
if timeout_sec
|
67
|
+
$logger.warn { "timeout_sec is depreacated. Use send_timeout_sec or read_timeout_sec instead" }
|
68
|
+
end
|
64
69
|
|
65
70
|
scope = "https://www.googleapis.com/auth/bigquery"
|
66
71
|
|
@@ -267,8 +272,17 @@ module Triglav::Agent
|
|
267
272
|
@retries ||= ENV['RETRIES'] || @connection_info.fetch(:retries, nil) || $setting.dig(:bigquery, :retries) || 5
|
268
273
|
end
|
269
274
|
|
275
|
+
# For google-api-client < 0.11.0. Deprecated
|
270
276
|
def timeout_sec
|
271
|
-
@timeout_sec ||= ENV['TIMEOUT_SEC'] || @connection_info.fetch(:timeout_sec, nil) || $setting.dig(:bigquery, :timeout_sec)
|
277
|
+
@timeout_sec ||= ENV['TIMEOUT_SEC'] || @connection_info.fetch(:timeout_sec, nil) || $setting.dig(:bigquery, :timeout_sec)
|
278
|
+
end
|
279
|
+
|
280
|
+
def send_timeout_sec
|
281
|
+
@send_timeout_sec ||= ENV['SEND_TIMEOUT_SEC'] || @connection_info.fetch(:send_timeout_sec, nil) || $setting.dig(:bigquery, :send_timeout_sec) || 60
|
282
|
+
end
|
283
|
+
|
284
|
+
def read_timeout_sec
|
285
|
+
@read_timeout_sec ||= ENV['READ_TIMEOUT_SEC'] || @connection_info.fetch(:read_timeout_sec, nil) || $setting.dig(:bigquery, :read_timeout_sec) || timeout_sec || 300
|
272
286
|
end
|
273
287
|
|
274
288
|
def open_timeout_sec
|
@@ -67,7 +67,7 @@ module Triglav::Agent
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def get_last_modified_times
|
70
|
-
last_modified_times = @status.get
|
70
|
+
last_modified_times = @status.get || {}
|
71
71
|
max_last_modified_time = last_modified_times[:max] || @status.getsetnx([:max], $setting.debug? ? 0 : get_current_time)
|
72
72
|
removes = last_modified_times.keys - tables.keys
|
73
73
|
appends = tables.keys - last_modified_times.keys
|
@@ -96,9 +96,9 @@ module Triglav::Agent
|
|
96
96
|
def self.resource_unit_valid?(resource)
|
97
97
|
units = resource.unit.split(',').sort
|
98
98
|
return false if units.size >= 2
|
99
|
-
if units.include?('hourly')
|
100
|
-
|
101
|
-
end
|
99
|
+
# if units.include?('hourly')
|
100
|
+
# return false unless resource.uri.match(/%H/)
|
101
|
+
# end
|
102
102
|
# if units.include?('daily')
|
103
103
|
# return false unless resource.uri.match(/%d/)
|
104
104
|
# end
|
@@ -112,7 +112,7 @@ module Triglav::Agent
|
|
112
112
|
return @dates if @dates
|
113
113
|
now = Time.now.localtime(resource.timezone)
|
114
114
|
@dates = resource.span_in_days.times.map do |i|
|
115
|
-
(now - (i *
|
115
|
+
(now - (i * 86400)).to_date
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
@@ -144,7 +144,7 @@ module Triglav::Agent
|
|
144
144
|
return @dates if @dates
|
145
145
|
now = Time.now.localtime(resource.timezone)
|
146
146
|
@dates = resource.span_in_days.times.map do |i|
|
147
|
-
(now - (i *
|
147
|
+
(now - (i * 86400)).to_date
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_dependency "triglav-agent"
|
23
23
|
spec.add_dependency "triglav_client"
|
24
|
-
spec.add_dependency "google-api-client"
|
24
|
+
spec.add_dependency "google-api-client", ">= 0.11.0"
|
25
25
|
spec.add_dependency "ini_file"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.11"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triglav-agent-bigquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Triglav Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: triglav-agent
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.11.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.11.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: ini_file
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -194,9 +194,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '0'
|
195
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- - "
|
197
|
+
- - ">="
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
199
|
+
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubyforge_project:
|
202
202
|
rubygems_version: 2.5.2
|