Method: Wavefront::Write#raw

Defined in:
lib/wavefront-sdk/write.rb

#raw(points, openclose = manage_conn) ⇒ Object

Send raw data to a Wavefront proxy, optionally automatically opening and closing the connection. (Or not, if that does not make sense in the context of the writer.)

Parameters:

  • points (Array[String])

    an array of points in native Wavefront wire format, as described in community.wavefront.com/docs/DOC-1031. No validation is performed.

  • openclose (Boolean) (defaults to: manage_conn)

    whether or not to automatically open a socket to the proxy before sending points, and afterwards, close it.



181
182
183
184
185
186
187
188
189
# File 'lib/wavefront-sdk/write.rb', line 181

def raw(points, openclose = manage_conn)
  writer.open if openclose && writer.respond_to?(:open)

  begin
    [points].flatten.each { |p| writer.send_point(p) }
  ensure
    writer.close if openclose && writer.respond_to?(:close)
  end
end