datahen 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datahen/cli/scraper.rb +3 -2
- data/lib/datahen/client/job_stat.rb +12 -4
- data/lib/datahen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5f93e47c85c172722c4517fe4af0805d81387a440fb06922fb5d6e941994f66
|
4
|
+
data.tar.gz: 1c895d1e6ec3e8415202d581ed9fe48e3c0443f53355b0ea34c0a3418b4e306d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc52173785501b7fe3ad3bd1de448d818033441eefb9a0526f68cb6a17595c4dda91e7f231501c4212892aaccda68e28ea2ac72c90ce5c89a7e78d06db5bf4b
|
7
|
+
data.tar.gz: d9fa5425007496e404258504127bedb1a7b786d609d9db15f6cdc485a2922aea5c7e8f25ca124142e0e41daadf22039d79c666f507029c3fc0c8388ca4a221df
|
data/lib/datahen/cli/scraper.rb
CHANGED
@@ -164,12 +164,13 @@ module Datahen
|
|
164
164
|
option :"max-timestamp", type: :string, desc: 'Ending timestamp point in time to query historic stats (inclusive)'
|
165
165
|
option :"limit", type: :numeric, desc: 'Limit stats retrieved'
|
166
166
|
option :"order", type: :numeric, desc: 'Order stats by timestamp [DESC]'
|
167
|
+
option :live, type: :boolean, desc: 'Get data from the live stats history, not cached stats history.'
|
167
168
|
def history(scraper_name)
|
168
169
|
client = Client::JobStat.new(options)
|
169
170
|
if options[:job]
|
170
|
-
puts "#{client.job_stats_history(options[:job])}"
|
171
|
+
puts "#{client.job_stats_history(options[:job], options)}"
|
171
172
|
else
|
172
|
-
puts "#{client.scraper_job_stats_history(scraper_name)}"
|
173
|
+
puts "#{client.scraper_job_stats_history(scraper_name, options)}"
|
173
174
|
end
|
174
175
|
end
|
175
176
|
|
@@ -18,12 +18,20 @@ module Datahen
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def job_stats_history(job_id)
|
22
|
-
|
21
|
+
def job_stats_history(job_id, opts={})
|
22
|
+
if opts[:live]
|
23
|
+
self.class.get("/jobs/#{job_id}/stats/history", @options)
|
24
|
+
else
|
25
|
+
self.class.get("/cached/jobs/#{job_id}/stats/history", @options)
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
|
-
def scraper_job_stats_history(scraper_name)
|
26
|
-
|
29
|
+
def scraper_job_stats_history(scraper_name, opts={})
|
30
|
+
if opts[:live]
|
31
|
+
self.class.get("/scrapers/#{scraper_name}/current_job/stats/history", @options)
|
32
|
+
else
|
33
|
+
self.class.get("/cached/scrapers/#{scraper_name}/current_job/stats/history", @options)
|
34
|
+
end
|
27
35
|
end
|
28
36
|
|
29
37
|
end
|
data/lib/datahen/version.rb
CHANGED