Class: TCellAgent::SensorEvents::AppSensorMetaEvent
- Inherits:
-
AppSensor::MetaData
- Object
- Hash
- TCellSensorEvent
- AppSensor::MetaData
- TCellAgent::SensorEvents::AppSensorMetaEvent
- Defined in:
- lib/tcell_agent/sensor_events/appsensor_meta_event.rb
Instance Attribute Summary collapse
-
#body_dict ⇒ Object
Returns the value of attribute body_dict.
-
#cookie_dict ⇒ Object
Returns the value of attribute cookie_dict.
-
#get_dict ⇒ Object
Returns the value of attribute get_dict.
-
#location ⇒ Object
Returns the value of attribute location.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path_parameters ⇒ Object
Returns the value of attribute path_parameters.
-
#post_dict ⇒ Object
Returns the value of attribute post_dict.
-
#remote_address ⇒ Object
Returns the value of attribute remote_address.
-
#request_content_bytes_len ⇒ Object
Returns the value of attribute request_content_bytes_len.
-
#request_headers ⇒ Object
Returns the value of attribute request_headers.
-
#response_code ⇒ Object
Returns the value of attribute response_code.
-
#response_content_bytes_len ⇒ Object
Returns the value of attribute response_content_bytes_len.
-
#response_headers ⇒ Object
Returns the value of attribute response_headers.
-
#route_id ⇒ Object
Returns the value of attribute route_id.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from TCellSensorEvent
Class Method Summary collapse
- .build(request, response_content_length, response_code, response_headers) ⇒ Object
- .build_basic(appsensor_meta) ⇒ Object
Instance Method Summary collapse
- #flattened_post_dict ⇒ Object
-
#initialize ⇒ AppSensorMetaEvent
constructor
A new instance of AppSensorMetaEvent.
- #post_process ⇒ Object
Methods inherited from AppSensor::MetaData
#flattened_body_dict, #flattened_cookie_dict, #flattened_get_dict, #flattened_path_parameters, #set_body_dict
Methods inherited from TCellSensorEvent
Constructor Details
#initialize ⇒ AppSensorMetaEvent
Returns a new instance of AppSensorMetaEvent.
84 85 86 87 88 89 90 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 84 def initialize super @request_content_bytes_len = 0 @response_content_bytes_len = 0 @user_agent = nil end |
Instance Attribute Details
#body_dict ⇒ Object
Returns the value of attribute body_dict.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def body_dict @body_dict end |
#cookie_dict ⇒ Object
Returns the value of attribute cookie_dict.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def end |
#get_dict ⇒ Object
Returns the value of attribute get_dict.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def get_dict @get_dict end |
#location ⇒ Object
Returns the value of attribute location.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def location @location end |
#method ⇒ Object
Returns the value of attribute method.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def method @method end |
#path_parameters ⇒ Object
Returns the value of attribute path_parameters.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def path_parameters @path_parameters end |
#post_dict ⇒ Object
Returns the value of attribute post_dict.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def post_dict @post_dict end |
#remote_address ⇒ Object
Returns the value of attribute remote_address.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def remote_address @remote_address end |
#request_content_bytes_len ⇒ Object
Returns the value of attribute request_content_bytes_len.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def request_content_bytes_len @request_content_bytes_len end |
#request_headers ⇒ Object
Returns the value of attribute request_headers.
82 83 84 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 82 def request_headers @request_headers end |
#response_code ⇒ Object
Returns the value of attribute response_code.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def response_code @response_code end |
#response_content_bytes_len ⇒ Object
Returns the value of attribute response_content_bytes_len.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def response_content_bytes_len @response_content_bytes_len end |
#response_headers ⇒ Object
Returns the value of attribute response_headers.
82 83 84 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 82 def response_headers @response_headers end |
#route_id ⇒ Object
Returns the value of attribute route_id.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def route_id @route_id end |
#session_id ⇒ Object
Returns the value of attribute session_id.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def session_id @session_id end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def transaction_id @transaction_id end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def user_agent @user_agent end |
#user_id ⇒ Object
Returns the value of attribute user_id.
78 79 80 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 78 def user_id @user_id end |
Class Method Details
.build(request, response_content_length, response_code, response_headers) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 23 def build(request, response_content_length, response_code, response_headers) = AppSensorMetaEvent.new .remote_address = TCellAgent::Utils::Rails.better_ip(request) .method = request.request_method .location = "#{request.base_url}#{request.fullpath}" .request_headers = request.env .user_agent = request.env['HTTP_USER_AGENT'] .request_content_bytes_len = (request.content_length || 0).to_i .response_content_bytes_len = response_content_length .get_dict = request.GET . = request. # don't enqueue parameter values of unknown type to avoid any serialization issues .post_dict = TCellAgent::Utils::Params.flatten(request.POST) .response_code = response_code .response_headers = response_headers .path_parameters = request.env[TCellAgent::Instrumentation::TCELL_ID].path_parameters .route_id = request.env[TCellAgent::Instrumentation::TCELL_ID].route_id .transaction_id = request.env[TCellAgent::Instrumentation::TCELL_ID].transaction_id .session_id = request.env[TCellAgent::Instrumentation::TCELL_ID].hmac_session_id .user_id = request.env[TCellAgent::Instrumentation::TCELL_ID].user_id # Positions strio to the beginning of input, resetting lineno to zero. # rails 4.1 seems to read the stringIO directly and so body.gets is empty # this is called request.body.rewind .set_body_dict( .request_content_bytes_len, request.content_type, request.body.gets ) end |
.build_basic(appsensor_meta) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 63 def build_basic() = AppSensorMetaEvent.new .location = .location .method =.method .remote_address = .remote_address .route_id = .route_id .session_id = .session_id .user_id = .user_id .route_id = .route_id end |
Instance Method Details
#flattened_post_dict ⇒ Object
99 100 101 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 99 def flattened_post_dict @post_dict end |
#post_process ⇒ Object
92 93 94 95 96 97 |
# File 'lib/tcell_agent/sensor_events/appsensor_meta_event.rb', line 92 def post_process appsensor_policy = TCellAgent.policy(TCellAgent::PolicyTypes::AppSensor) return unless appsensor_policy appsensor_policy.(self) end |