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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculate_offset, #post_process

Constructor Details

#initialize(location, detection_point, method, remote_address, param, route_id, meta, hmac_session_id, user_id, payload, pattern, full_uri) ⇒ TCellAppSensorEvent



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

def initialize(location,
               detection_point,
               method,
               remote_address,
               param,
               route_id,
               meta,
               hmac_session_id,
               user_id,
               payload,
               pattern,
               full_uri)
  super('as')
  self['dp'] = detection_point

  self['param'] = param.to_s if param
  self['m'] = method.to_s if method
  self['pattern'] = pattern if pattern
  self['meta'] = meta if meta
  self['rid'] = route_id.to_s if route_id
  self['full_uri'] = full_uri if full_uri
  self['uri'] = location if location
  self['uid'] = user_id.to_s if user_id
  self['sid'] = hmac_session_id if hmac_session_id
  self['remote_addr'] = remote_address.to_s if remote_address
  self['payload'] = payload if payload
end

Class Method Details

.build_from_native_lib_event(event) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/tcell_agent/sensor_events/appsensor_event.rb', line 34

def self.build_from_native_lib_event(event)
  TCellAppSensorEvent.new(
    event['uri'],
    event['detection_point'],
    event['method'],
    event['remote_address'],
    event['parameter'],
    event['route_id'],
    event['meta'],
    event['session_id'],
    event['user_id'],
    event['payload'],
    event['pattern'],
    event['full_uri']
  )
end