Class: ZAPv2::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/zap/v2apis/stats.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Stats

Returns a new instance of Stats.



5
6
7
# File 'lib/zap/v2apis/stats.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#all_sites_stats(key_prefix) ⇒ Object



9
10
11
# File 'lib/zap/v2apis/stats.rb', line 9

def all_sites_stats(key_prefix)
  @client.get("/JSON/stats/view/allSitesStats/?keyPrefix=#{key_prefix}")
end

#clear_stats(key_prefix) ⇒ Object



41
42
43
# File 'lib/zap/v2apis/stats.rb', line 41

def clear_stats(key_prefix)
  @client.get("/JSON/stats/action/clearStats/?keyPrefix=#{key_prefix}")
end

#option_in_memory_enabledObject



13
14
15
# File 'lib/zap/v2apis/stats.rb', line 13

def option_in_memory_enabled
  @client.get('/JSON/stats/view/optionInMemoryEnabled/')
end

#option_statsd_enabledObject



17
18
19
# File 'lib/zap/v2apis/stats.rb', line 17

def option_statsd_enabled
  @client.get('/JSON/stats/view/optionStatsdEnabled/')
end

#option_statsd_hostObject



21
22
23
# File 'lib/zap/v2apis/stats.rb', line 21

def option_statsd_host
  @client.get('/JSON/stats/view/optionStatsdHost/')
end

#option_statsd_portObject



25
26
27
# File 'lib/zap/v2apis/stats.rb', line 25

def option_statsd_port
  @client.get('/JSON/stats/view/optionStatsdPort/')
end

#option_statsd_prefixObject



29
30
31
# File 'lib/zap/v2apis/stats.rb', line 29

def option_statsd_prefix
  @client.get('/JSON/stats/view/optionStatsdPrefix/')
end

#set_option_in_memory_enabled(boolean) ⇒ Object



45
46
47
# File 'lib/zap/v2apis/stats.rb', line 45

def set_option_in_memory_enabled(boolean)
  @client.get("/JSON/stats/action/setOptionInMemoryEnabled/?boolean=#{boolean}")
end

#set_option_statsd_host(string) ⇒ Object



49
50
51
# File 'lib/zap/v2apis/stats.rb', line 49

def set_option_statsd_host(string)
  @client.get("/JSON/stats/action/setOptionStatsdHost/?String=#{string}")
end

#set_option_statsd_port(integer) ⇒ Object



53
54
55
# File 'lib/zap/v2apis/stats.rb', line 53

def set_option_statsd_port(integer)
  @client.get("/JSON/stats/action/setOptionStatsdPort/?Integer=#{integer}")
end

#set_option_statsd_prefix(string) ⇒ Object



57
58
59
# File 'lib/zap/v2apis/stats.rb', line 57

def set_option_statsd_prefix(string)
  @client.get("/JSON/stats/action/setOptionStatsdPrefix/?String=#{string}")
end

#site_stats(site, key_prefix) ⇒ Object



33
34
35
# File 'lib/zap/v2apis/stats.rb', line 33

def site_stats(site, key_prefix)
  @client.get("/JSON/stats/view/siteStats/?site=#{site}&keyPrefix=#{key_prefix}")
end

#stats(key_prefix) ⇒ Object



37
38
39
# File 'lib/zap/v2apis/stats.rb', line 37

def stats(key_prefix)
  @client.get("/JSON/stats/view/stats/?keyPrefix=#{key_prefix}")
end