class DogapiDemo::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-demo/metric.rb 16 def submit(api_key, scope, metric, points) 17 warn "[DEPRECATION] DogapiDemo::MetricService.submit() has been deprecated in favor of the newer V1 services" 18 series = [{ 19 :host => scope.host, 20 :device => scope.device, 21 :metric => metric, 22 :points => points.map { |p| [p[0].to_i, p[1]] } 23 }] 24 25 params = { 26 :api_key => api_key, 27 :api_version => API_VERSION, 28 :series => series.to_json 29 } 30 31 request Net::HTTP::Post, '/series/submit', params 32 end