Class: TCellAgent::AppSensor::MetaData
- Inherits:
-
SensorEvents::TCellSensorEvent
- Object
- Hash
- SensorEvents::TCellSensorEvent
- TCellAgent::AppSensor::MetaData
- Defined in:
- lib/tcell_agent/appsensor/meta_data.rb
Direct Known Subclasses
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.
-
#path_parameters ⇒ Object
Returns the value of attribute path_parameters.
-
#post_dict ⇒ Object
Returns the value of attribute post_dict.
Attributes inherited from SensorEvents::TCellSensorEvent
Instance Method Summary collapse
- #flattened_body_dict ⇒ Object
- #flattened_cookie_dict ⇒ Object
- #flattened_get_dict ⇒ Object
- #flattened_path_parameters ⇒ Object
- #flattened_post_dict ⇒ Object
-
#initialize ⇒ MetaData
constructor
A new instance of MetaData.
- #set_body_dict(request_content_bytes_len, request_content_type, request_body) ⇒ Object
Methods inherited from SensorEvents::TCellSensorEvent
#bucket_key, #calculateOffset, #post_process
Constructor Details
#initialize ⇒ MetaData
Returns a new instance of MetaData.
12 13 14 15 16 17 18 19 20 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 12 def initialize @send = false @body_dict = {} @get_dict = {} @post_dict = {} @cookie_dict = {} @path_parameters = {} end |
Instance Attribute Details
#body_dict ⇒ Object
Returns the value of attribute body_dict.
10 11 12 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 10 def body_dict @body_dict end |
#cookie_dict ⇒ Object
Returns the value of attribute cookie_dict.
10 11 12 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 10 def @cookie_dict end |
#get_dict ⇒ Object
Returns the value of attribute get_dict.
10 11 12 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 10 def get_dict @get_dict end |
#path_parameters ⇒ Object
Returns the value of attribute path_parameters.
10 11 12 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 10 def path_parameters @path_parameters end |
#post_dict ⇒ Object
Returns the value of attribute post_dict.
10 11 12 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 10 def post_dict @post_dict end |
Instance Method Details
#flattened_body_dict ⇒ Object
40 41 42 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 40 def flattened_body_dict @body_dict end |
#flattened_cookie_dict ⇒ Object
44 45 46 47 48 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 44 def @flattened_cookie_dict ||= TCellAgent::Utils::Params.flatten(@cookie_dict) @flattened_cookie_dict end |
#flattened_get_dict ⇒ Object
28 29 30 31 32 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 28 def flattened_get_dict @flattened_get_dict ||= TCellAgent::Utils::Params.flatten(@get_dict) @flattened_get_dict end |
#flattened_path_parameters ⇒ Object
22 23 24 25 26 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 22 def flattened_path_parameters @flattened_path_parameters ||= TCellAgent::Utils::Params.flatten(@path_parameters) @flattened_path_parameters end |
#flattened_post_dict ⇒ Object
34 35 36 37 38 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 34 def flattened_post_dict @flattened_post_dict ||= TCellAgent::Utils::Params.flatten(@post_dict) @flattened_post_dict end |
#set_body_dict(request_content_bytes_len, request_content_type, request_body) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/tcell_agent/appsensor/meta_data.rb', line 50 def set_body_dict(request_content_bytes_len, request_content_type, request_body) if request_content_bytes_len > 2000000 @body_dict = {} else if request_content_type =~ %r{application/json}i && request_body begin # don't enqueue parameter values of unknown type to avoid any serialization issues @body_dict = TCellAgent::Utils::Params.flatten(JSON.parse(request_body)) rescue TCellAgent.logger.debug("JSON body parameter parsing failed") @body_dict = {} end else @body_dict = {} end end end |