class Wavefront::Writer::Http
HTTP POST points to a local proxy. This method does not support any authentication or authorization, as these are not supported by the proxy at the time of writing. When the proxy acquires these functions, a new writer will be made.
Public Instance Methods
api_path()
click to toggle source
# File lib/wavefront-sdk/writers/http.rb, line 23 def api_path nil end
chunk_size()
click to toggle source
# File lib/wavefront-sdk/writers/http.rb, line 38 def chunk_size 100 end
default_port()
click to toggle source
# File lib/wavefront-sdk/writers/http.rb, line 27 def default_port 2878 end
open()
click to toggle source
# File lib/wavefront-sdk/writers/http.rb, line 15 def open creds[:endpoint] = format('%<proxy>s:%<port>s', proxy: creds[:proxy], port: creds[:port] || default_port) opts[:scheme] = 'http' @conn = Wavefront::ApiCaller.new(self, creds, opts) end
validate_credentials(creds)
click to toggle source
# File lib/wavefront-sdk/writers/http.rb, line 31 def validate_credentials(creds) return true if creds.key?(:proxy) && creds[:proxy] raise(Wavefront::Exception::CredentialError, 'credentials must contain proxy address') end
Private Instance Methods
_send_point(point)
click to toggle source
# File lib/wavefront-sdk/writers/http.rb, line 44 def _send_point(point) conn.post(nil, point).ok? end