Sha256: 0f773eb7e684e0b87f823da3bf92554f145aa990e46242448219a2c5db00e9bf
Contents?: true
Size: 993 Bytes
Versions: 22
Compression:
Stored size: 993 Bytes
Contents
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. require 'base64' require 'zlib' module NewRelic module Agent class NewRelicService module Encoders module Identity def self.encode(data, opts=nil) data end end module Compressed def self.encode(data, opts=nil) Zlib::Deflate.deflate(data, Zlib::DEFAULT_COMPRESSION) end end module Base64CompressedJSON def self.encode(data, opts={}) normalize_encodings = if opts[:skip_normalization] false else Agent.config[:normalize_json_string_encodings] end json = ::NewRelic::JSONWrapper.dump(data, :normalize => normalize_encodings) Base64.encode64(Compressed.encode(json)) end end end end end end
Version data entries
22 entries across 22 versions & 2 rubygems