class Wavefront::Writer::Summary
Count and report on points we attempt to send to Wavefront
.
Attributes
rejected[RW]
sent[RW]
unsent[RW]
Public Class Methods
new()
click to toggle source
# File lib/wavefront-sdk/writers/summary.rb, line 11 def initialize @sent = 0 @rejected = 0 @unsent = 0 end
Public Instance Methods
ok?()
click to toggle source
Were all points sent successfully? (This does not necessarily mean they were received – it depends on the writer class. Sockets are dumb, HTTP is smart.) @return [Bool]
# File lib/wavefront-sdk/writers/summary.rb, line 28 def ok? unsent.zero? && rejected.zero? end
result()
click to toggle source
@return [String] OK if all points were sent, ERROR if not
# File lib/wavefront-sdk/writers/summary.rb, line 19 def result ok? ? 'OK' : 'ERROR' end
to_h()
click to toggle source
Representation of summary as it used to be when it was built into the Write
class @return [Hash]
# File lib/wavefront-sdk/writers/summary.rb, line 36 def to_h { sent: sent, rejected: rejected, unsent: unsent } end