Class: NewRelic::Agent::NewRelicService::PrubyMarshaller
- Inherits:
-
Marshaller
- Object
- Marshaller
- NewRelic::Agent::NewRelicService::PrubyMarshaller
show all
- Defined in:
- lib/new_relic/agent/new_relic_service.rb
Overview
Primitive Ruby Object Notation which complies JSON format data strutures
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Marshaller
#default_encoder, human_readable?, #parsed_error, #prepare
Constructor Details
Returns a new instance of PrubyMarshaller.
449
450
451
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 449
def initialize
::NewRelic::Agent.logger.debug 'Using Pruby marshaller'
end
|
Class Method Details
.is_supported? ⇒ Boolean
476
477
478
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 476
def self.is_supported?
true
end
|
Instance Method Details
#dump(ruby, opts = {}) ⇒ Object
453
454
455
456
457
458
459
460
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 453
def dump(ruby, opts={})
NewRelic::LanguageSupport.with_cautious_gc do
Marshal.dump(prepare(ruby, opts))
end
rescue => e
::NewRelic::Agent.logger.debug("#{e.class.name} : #{e.message} when marshalling #{ruby.inspect}")
raise
end
|
472
473
474
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 472
def format
'pruby'
end
|
#load(data) ⇒ Object
462
463
464
465
466
467
468
469
470
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 462
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
|