Class: Fluent::Plugin::ProcInfo::Eventer

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/proc_info/eventer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timestamp_key:, timestamp_format:, event_prefix:, metadata_prefix:) ⇒ Eventer

Returns a new instance of Eventer.



11
12
13
14
15
16
17
18
19
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 11

def initialize(timestamp_key:,
               timestamp_format:,
               event_prefix:,
               metadata_prefix:)
  @timestamp_key = timestamp_key
  @timestamp_format = timestamp_format
  @event_prefix = event_prefix
   = 
end

Instance Attribute Details

#event_prefixObject (readonly)

Returns the value of attribute event_prefix.



9
10
11
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9

def event_prefix
  @event_prefix
end

#metadata_prefixObject (readonly)

Returns the value of attribute metadata_prefix.



9
10
11
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9

def 
  
end

#timestamp_formatObject (readonly)

Returns the value of attribute timestamp_format.



9
10
11
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9

def timestamp_format
  @timestamp_format
end

#timestamp_keyObject (readonly)

Returns the value of attribute timestamp_key.



9
10
11
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 9

def timestamp_key
  @timestamp_key
end

Instance Method Details

#generate_event(name:, value:, metadata: {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/fluent/plugin/proc_info/eventer.rb', line 21

def generate_event(name:, value:, metadata: {})
  base.update({
                "#{event_prefix}name" => name,
                "#{event_prefix}value" => value
              })
      .update(.transform_keys { |k| "#{metadata_prefix}#{k}" })
end