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

Returns a new instance of TCellSensorEvent.



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

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

Instance Attribute Details

#ensureObject

Returns the value of attribute ensure.



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

def ensure
  @ensure
end

#flushObject

Returns the value of attribute flush.



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

def flush
  @flush
end

#sendObject

Returns the value of attribute send.



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

def send
  @send
end

Instance Method Details

#bucket_keyObject



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

def bucket_key
  return nil
end

#calculateOffset(from_timestamp) ⇒ Object



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

def calculateOffset(from_timestamp)
  self["offset"] = from_timestamp - @timestamp
end

#post_processObject



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

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