class Dogapi::MetricService

DEPRECATED: Going forward, use the V1 services. This legacy service will be removed in an upcoming release.

Constants

API_VERSION

Public Instance Methods

submit(api_key, scope, metric, points) click to toggle source

DEPRECATED: Going forward, use the V1 services. This legacy service will be removed in an upcoming release.

   # File lib/dogapi/metric.rb
20 def submit(api_key, scope, metric, points)
21   warn '[DEPRECATION] Dogapi::MetricService.submit() has been deprecated in favor of the newer V1 services'
22   series = [{
23     :host    =>  scope.host,
24     :device  =>  scope.device,
25     :metric  =>  metric,
26     :points  =>  points.map { |p| [p[0].to_i, p[1]] }
27   }]
28 
29   params = {
30     :api_key      =>  api_key,
31     :api_version  =>  API_VERSION,
32     :series       =>  series.to_json
33   }
34 
35   request Net::HTTP::Post, '/series/submit', params
36 end