datahen 0.14.3 → 0.14.4

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
  SHA256:
3
- metadata.gz: b00adfb4f357beeae276a130cc5e0ee1d34ddd8bdef4a0374f4b55f89f894460
4
- data.tar.gz: 6363d591d93d99addcaaea6d964b2fb07e4d8222f873c3a8f6496f48c97b1483
3
+ metadata.gz: b5f93e47c85c172722c4517fe4af0805d81387a440fb06922fb5d6e941994f66
4
+ data.tar.gz: 1c895d1e6ec3e8415202d581ed9fe48e3c0443f53355b0ea34c0a3418b4e306d
5
5
  SHA512:
6
- metadata.gz: 75e9f1b1e5ba61563c3ff9d12071cb76d77382353003776d88817940623e37aeb300df2114260f86a5a18a59e1dc9f74a33c00029e183c0681c616dce109d6c6
7
- data.tar.gz: 8e2a07b11d20fe88c93aa0af0abf10ceb6593d5d2db63d9b5c3744c6f8b59754274a3949b6331d7d71a3018f7cf65e1a7d31e2ab6f4dbbcde494b33357dab40a
6
+ metadata.gz: 0bc52173785501b7fe3ad3bd1de448d818033441eefb9a0526f68cb6a17595c4dda91e7f231501c4212892aaccda68e28ea2ac72c90ce5c89a7e78d06db5bf4b
7
+ data.tar.gz: d9fa5425007496e404258504127bedb1a7b786d609d9db15f6cdc485a2922aea5c7e8f25ca124142e0e41daadf22039d79c666f507029c3fc0c8388ca4a221df
@@ -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
- self.class.get("/jobs/#{job_id}/stats/history", @options)
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
- self.class.get("/scrapers/#{scraper_name}/current_job/stats/history", @options)
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
@@ -1,3 +1,3 @@
1
1
  module Datahen
2
- VERSION = "0.14.3"
2
+ VERSION = "0.14.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datahen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parama Danoesubroto