embulk-input-mixpanel 0.4.6 → 0.4.7
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/embulk-input-mixpanel.gemspec +1 -1
- data/lib/embulk/input/mixpanel.rb +18 -10
- 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: 8dd90cee458d5d530256723966f6cb61dceff1a0
|
|
4
|
+
data.tar.gz: 4ece79001e62af4c065423161a2aadbb2c0b6f1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 76d1b685cb7d7d66f8a8eeea81d010ecc3bec1e9a49ce2c3328f4b2f9f4086eb0a46fb61e83f5d45084ba33c664c94e70fc1cdf5201153cff6df48cbedd40ac9
|
|
7
|
+
data.tar.gz: 24ae64c8d5cfe45081fa3f8d5647a7d365cad2b349d8f6039e66b4f35ce1a7b6be9af4ec211c7c6b9f046ab0d466e934cdabb87e0ca876641cd8d25efe117d27
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## 0.4.7 - 2016-09-08
|
|
2
|
+
* [fixed] Retry was only enabled on preview and run. [#45](https://github.com/treasure-data/embulk-input-mixpanel/pull/45)
|
|
3
|
+
|
|
1
4
|
## 0.4.6 - 2016-09-07
|
|
2
5
|
* [enhancement] Retry with too frequency requests error [#44](https://github.com/treasure-data/embulk-input-mixpanel/pull/44)
|
|
3
6
|
|
|
@@ -91,7 +91,12 @@ module Embulk
|
|
|
91
91
|
def self.guess(config)
|
|
92
92
|
giveup_when_mixpanel_is_down
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
retryer = perfect_retry({
|
|
95
|
+
retry_initial_wait_sec: config.param(:retry_initial_wait_sec, :integer, default: 1),
|
|
96
|
+
retry_limit: config.param(:retry_limit, :integer, default: 5),
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
client = MixpanelApi::Client.new(config.param(:api_key, :string), config.param(:api_secret, :string), retryer)
|
|
95
100
|
|
|
96
101
|
range = guess_range(config)
|
|
97
102
|
Embulk.logger.info "Guessing schema using #{range.first}..#{range.last} records"
|
|
@@ -105,6 +110,17 @@ module Embulk
|
|
|
105
110
|
return {"columns" => columns}
|
|
106
111
|
end
|
|
107
112
|
|
|
113
|
+
def self.perfect_retry(task)
|
|
114
|
+
PerfectRetry.new do |config|
|
|
115
|
+
config.limit = task[:retry_limit]
|
|
116
|
+
config.sleep = proc{|n| task[:retry_initial_wait_sec] * (2 * (n - 1)) }
|
|
117
|
+
config.dont_rescues = [Embulk::ConfigError]
|
|
118
|
+
config.rescues = [RuntimeError]
|
|
119
|
+
config.log_level = nil
|
|
120
|
+
config.logger = Embulk.logger
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
108
124
|
def init
|
|
109
125
|
@api_key = task[:api_key]
|
|
110
126
|
@api_secret = task[:api_secret]
|
|
@@ -113,14 +129,6 @@ module Embulk
|
|
|
113
129
|
@schema = task[:schema]
|
|
114
130
|
@dates = task[:dates]
|
|
115
131
|
@fetch_unknown_columns = task[:fetch_unknown_columns]
|
|
116
|
-
@retryer = PerfectRetry.new do |config|
|
|
117
|
-
config.limit = task[:retry_limit]
|
|
118
|
-
config.sleep = proc{|n| task[:retry_initial_wait_sec] * (2 * (n - 1)) }
|
|
119
|
-
config.dont_rescues = [Embulk::ConfigError]
|
|
120
|
-
config.rescues = [RuntimeError]
|
|
121
|
-
config.log_level = nil
|
|
122
|
-
config.logger = Embulk.logger
|
|
123
|
-
end
|
|
124
132
|
end
|
|
125
133
|
|
|
126
134
|
def run
|
|
@@ -210,7 +218,7 @@ module Embulk
|
|
|
210
218
|
"from_date" => from_date,
|
|
211
219
|
"to_date" => to_date,
|
|
212
220
|
)
|
|
213
|
-
client = MixpanelApi::Client.new(@api_key, @api_secret,
|
|
221
|
+
client = MixpanelApi::Client.new(@api_key, @api_secret, self.class.perfect_retry(task))
|
|
214
222
|
|
|
215
223
|
if preview?
|
|
216
224
|
client.export_for_small_dataset(params)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: embulk-input-mixpanel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yoshihara
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2016-09-
|
|
12
|
+
date: 2016-09-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|