Class: InfluxReporter::EventMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/influx_reporter/event_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, message, attrs = {}) {|_self| ... } ⇒ EventMessage

Returns a new instance of EventMessage.

Yields:

  • (_self)

Yield Parameters:



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/influx_reporter/event_message.rb', line 10

def initialize(config, message, attrs = {})
  @config = config

  @message = message
  @timestamp = Util.nanos

  attrs.each do |k, v|
    send(:"#{k}=", v)
  end

  yield self if block_given?
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



23
24
25
# File 'lib/influx_reporter/event_message.rb', line 23

def config
  @config
end

#databaseObject

Returns the value of attribute database.



27
28
29
# File 'lib/influx_reporter/event_message.rb', line 27

def database
  @database
end

#extraObject

Returns the value of attribute extra.



26
27
28
# File 'lib/influx_reporter/event_message.rb', line 26

def extra
  @extra
end

#messageObject

Returns the value of attribute message.



24
25
26
# File 'lib/influx_reporter/event_message.rb', line 24

def message
  @message
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



25
26
27
# File 'lib/influx_reporter/event_message.rb', line 25

def timestamp
  @timestamp
end

Instance Method Details

#add_extra(info) ⇒ Object



29
30
31
32
# File 'lib/influx_reporter/event_message.rb', line 29

def add_extra(info)
  @extra ||= {}
  @extra.deep_merge! info
end