Class: InfluxReporter::EventMessage
- Inherits:
-
Object
- Object
- InfluxReporter::EventMessage
- Defined in:
- lib/influx_reporter/event_message.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#database ⇒ Object
Returns the value of attribute database.
-
#extra ⇒ Object
Returns the value of attribute extra.
-
#message ⇒ Object
Returns the value of attribute message.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #add_extra(info) ⇒ Object
-
#initialize(config, message, attrs = {}) {|_self| ... } ⇒ EventMessage
constructor
A new instance of EventMessage.
Constructor Details
#initialize(config, message, attrs = {}) {|_self| ... } ⇒ EventMessage
Returns a new instance of EventMessage.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/influx_reporter/event_message.rb', line 10 def initialize(config, , attrs = {}) @config = config @message = @timestamp = Util.nanos attrs.each do |k, v| send(:"#{k}=", v) end yield self if block_given? end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
23 24 25 |
# File 'lib/influx_reporter/event_message.rb', line 23 def config @config end |
#database ⇒ Object
Returns the value of attribute database.
27 28 29 |
# File 'lib/influx_reporter/event_message.rb', line 27 def database @database end |
#extra ⇒ Object
Returns the value of attribute extra.
26 27 28 |
# File 'lib/influx_reporter/event_message.rb', line 26 def extra @extra end |
#message ⇒ Object
Returns the value of attribute message.
24 25 26 |
# File 'lib/influx_reporter/event_message.rb', line 24 def @message end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
25 26 27 |
# File 'lib/influx_reporter/event_message.rb', line 25 def @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 |