Method: Wavefront::Write#write

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

#write(points = [], openclose = manage_conn, prefix = nil) ⇒ Boolean

POST /report A wrapper to the writer class’s #write method. Writers implement this method differently, Check the appropriate class documentation for @return information etc. The signature is always the same.

Returns:

  • (Boolean)

    false should any chunk fail

Raises:

  • any exceptions raised by the writer classes are passed through



100
101
102
103
104
105
106
107
108
# File 'lib/wavefront-sdk/write.rb', line 100

def write(points = [], openclose = manage_conn, prefix = nil)
  resps = [points].flatten.each_slice(chunk_size).map do |chunk|
    resp = writer.write(chunk, openclose, prefix)
    sleep(opts[:chunk_pause])
    resp
  end

  composite_response(resps)
end