Class: NewRelic::Agent::NewRelicService::PrubyMarshaller
- Inherits:
-
Marshaller
- Object
- Marshaller
- NewRelic::Agent::NewRelicService::PrubyMarshaller
- Defined in:
- lib/new_relic/agent/new_relic_service.rb
Overview
Primitive Ruby Object Notation which complies JSON format data strutures
Instance Attribute Summary
Attributes inherited from Marshaller
Class Method Summary collapse
Instance Method Summary collapse
- #dump(ruby) ⇒ Object
- #format ⇒ Object
-
#initialize ⇒ PrubyMarshaller
constructor
A new instance of PrubyMarshaller.
- #load(data) ⇒ Object
Methods inherited from Marshaller
Constructor Details
#initialize ⇒ PrubyMarshaller
Returns a new instance of PrubyMarshaller.
325 326 327 |
# File 'lib/new_relic/agent/new_relic_service.rb', line 325 def initialize NewRelic::Agent.logger.debug 'Using Pruby marshaller' end |
Class Method Details
.is_supported? ⇒ Boolean
352 353 354 |
# File 'lib/new_relic/agent/new_relic_service.rb', line 352 def self.is_supported? true end |
Instance Method Details
#dump(ruby) ⇒ Object
329 330 331 332 333 334 335 336 |
# File 'lib/new_relic/agent/new_relic_service.rb', line 329 def dump(ruby) NewRelic::LanguageSupport.with_cautious_gc do compress(Marshal.dump(prepare(ruby))) end rescue => e NewRelic::Agent.logger.debug("#{e.class.name} : #{e.} when marshalling #{ruby.inspect}") raise end |
#format ⇒ Object
348 349 350 |
# File 'lib/new_relic/agent/new_relic_service.rb', line 348 def format 'pruby' end |
#load(data) ⇒ Object
338 339 340 341 342 343 344 345 346 |
# File 'lib/new_relic/agent/new_relic_service.rb', line 338 def load(data) return unless data && data != '' NewRelic::LanguageSupport.with_cautious_gc do return_value(Marshal.load(data)) end rescue NewRelic::Agent.logger.debug "Error encountered loading collector response: #{data}" raise end |