Module: NewRelic::Agent::NewRelicService::Encoders::Base64CompressedJSON

Defined in:
lib/new_relic/agent/new_relic_service/encoders.rb

Class Method Summary collapse

Class Method Details

.encode(data, opts = {}) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/new_relic/agent/new_relic_service/encoders.rb', line 43

def self.encode(data, opts = {})
  if !opts[:skip_normalization] && Agent.config[:normalize_json_string_encodings]
    data = NewRelic::Agent::EncodingNormalizer.normalize_object(data)
  end
  json = ::JSON.dump(data)
  NewRelic::Base64.encode64(Compressed::Deflate.encode(json))
end