Class: Datahen::Client::JobStat

Inherits:
Base
  • Object
show all
Defined in:
lib/datahen/client/job_stat.rb

Constant Summary

Constants inherited from Base

Base::CHECK_EMPTY_BODY, Base::CHECK_NIL, Base::DEFAULT_RETRY_LIMIT

Instance Method Summary collapse

Methods inherited from Base

#auth_token, #auth_token=, #default_retry_limit, #env_api_url, env_auth_token, env_ignore_ssl, #ignore_ssl, #initialize, #left_merge, random_delay, #retry

Constructor Details

This class inherits a constructor from Datahen::Client::Base

Instance Method Details

#job_current_stats(job_id, opts = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/datahen/client/job_stat.rb', line 5

def job_current_stats(job_id, opts={})
  if opts[:live]
    self.class.get("/jobs/#{job_id}/stats/current", @options)
  else
    self.class.get("/cached/jobs/#{job_id}/stats/current", @options)
  end
end

#job_stats_history(job_id, opts = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/datahen/client/job_stat.rb', line 21

def job_stats_history(job_id, opts={})
  if opts[:live]
    self.class.get("/jobs/#{job_id}/stats/history", @options)
  else
    self.class.get("/cached/jobs/#{job_id}/stats/history", @options)
  end
end

#scraper_job_current_stats(scraper_name, opts = {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/datahen/client/job_stat.rb', line 13

def scraper_job_current_stats(scraper_name, opts={})
  if opts[:live]
    self.class.get("/scrapers/#{scraper_name}/current_job/stats/current", @options)
  else
    self.class.get("/cached/scrapers/#{scraper_name}/current_job/stats/current", @options)
  end
end

#scraper_job_stats_history(scraper_name, opts = {}) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/datahen/client/job_stat.rb', line 29

def scraper_job_stats_history(scraper_name, opts={})
  if opts[:live]
    self.class.get("/scrapers/#{scraper_name}/current_job/stats/history", @options)
  else
    self.class.get("/cached/scrapers/#{scraper_name}/current_job/stats/history", @options)
  end
end