Class: TCellAgent::SensorEvents::TCellSensorEvent

Inherits:
Hash
  • Object
show all
Defined in:
lib/tcell_agent/sensor_events/sensor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_type) ⇒ TCellSensorEvent



12
13
14
15
16
17
18
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 12

def initialize(event_type)
  @send = true
  @flush = false
  @ensure = false
  @timestamp = Time.now.to_i
  self['event_type'] = event_type
end

Instance Attribute Details

#ensureObject

Returns the value of attribute ensure.



10
11
12
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 10

def ensure
  @ensure
end

#flushObject

Returns the value of attribute flush.



10
11
12
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 10

def flush
  @flush
end

#sendObject

Returns the value of attribute send.



10
11
12
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 10

def send
  @send
end

Instance Method Details

#bucket_keyObject



29
30
31
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 29

def bucket_key
  nil
end

#calculate_offset(from_timestamp) ⇒ Object



20
21
22
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 20

def calculate_offset(from_timestamp)
  self['offset'] = from_timestamp - @timestamp
end

#post_processObject



24
25
26
27
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 24

def post_process
  # This is called in the background thread, so any
  # santization, analysis, etc doesn't get in the way
end