Module: Zeus::MetricsInterface
Overview
Interface for dealing with metrics api calls
Instance Method Summary collapse
-
#delete_metrics(name) ⇒ Zeus::APIClient::Result
delete metrics.
-
#get_metrics(options = {}) ⇒ Zeus::APIClient::Result
Get metrics.
-
#list_metrics(options = {}) ⇒ Zeus::APIClient::Result
Get metrics list.
-
#send_metrics(name, metrics) ⇒ Zeus::APIClient::Result
Send metrics list.
Instance Method Details
#delete_metrics(name) ⇒ Zeus::APIClient::Result
delete metrics
80 81 82 83 |
# File 'lib/zeus/api_client/metrics_interface.rb', line 80 def delete_metrics(name) response = delete("/metrics/#{@access_token}/#{name}/") Result.new(response) end |
#get_metrics(options = {}) ⇒ Zeus::APIClient::Result
Get metrics
70 71 72 73 74 75 |
# File 'lib/zeus/api_client/metrics_interface.rb', line 70 def get_metrics( = {}) response = get("/metrics/#{@access_token}/_values/", ) Result.new(response) rescue => e Result.new(e.response) end |
#list_metrics(options = {}) ⇒ Zeus::APIClient::Result
Get metrics list
36 37 38 39 40 41 |
# File 'lib/zeus/api_client/metrics_interface.rb', line 36 def list_metrics( = {}) response = get("/metrics/#{@access_token}/_names/", ) Result.new(response) rescue => e Result.new(e.response) end |
#send_metrics(name, metrics) ⇒ Zeus::APIClient::Result
Send metrics list
48 49 50 51 52 53 54 55 56 |
# File 'lib/zeus/api_client/metrics_interface.rb', line 48 def send_metrics(name, metrics) params = { metrics: metrics } begin response = post("/metrics/#{@access_token}/#{name}/", params) Result.new(response) rescue => e Result.new(e.response) end end |