Class: TCellAgent::SensorEvents::TCellAppSensorEvent

Inherits:
TCellSensorEvent show all
Defined in:
lib/tcell_agent/sensor_events/appsensor_event.rb

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculateOffset

Constructor Details

#initialize(location, detection_point, method, remote_addr, param, route_id, meta = nil, hmac_session_id = nil, user_id = nil, payload = nil, pattern = nil) ⇒ TCellAppSensorEvent

Returns a new instance of TCellAppSensorEvent.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/tcell_agent/sensor_events/appsensor_event.rb', line 9

def initialize(location,
               detection_point,
               method,
               remote_addr,
               param,
               route_id,
               meta=nil,
               hmac_session_id=nil,
               user_id=nil,
               payload=nil,
               pattern=nil)
  super("as")
  self["dp"] = detection_point
  self["param"] = param.to_s if param
  self["remote_addr"] = remote_addr.to_s if remote_addr
  self["m"] = method.to_s if method
  @raw_location = location
  @user_id = user_id
  @hmac_session_id = hmac_session_id
  @payload = payload

  self["pattern"] = pattern if pattern
  self["meta"] = meta if meta
  self["rid"] = route_id if route_id
end

Instance Method Details

#post_processObject



35
36
37
38
39
40
41
42
# File 'lib/tcell_agent/sensor_events/appsensor_event.rb', line 35

def post_process
  self["uri"] = Util.strip_uri_values(@raw_location)
  self["uid"] = @user_id.to_s if @user_id
  if @hmac_session_id
    self["sid"] = @hmac_session_id
  end
  self["payload"] = @payload[0..150] if @payload
end