We appear to be using what I hypothesize is a fork of an older version of the Zlib gem's gzip compression logic to gzip our outbound payloads.
We should see if we can modernize our approach while retaining compatibility with all supported Ruby versions.
To gzip some data, we should need only to do this:
require 'zlib'
Zlib.gzip(text)
We may be able to replace the module NewRelic::Agent::Encoders::Compressed::Gzip with the code above. It is used in NewRelic::Agent::Service#compress_request_if_needed
Acceptance Criteria
Make sure the included Zlib library works on all agent-supported Ruby versions
Run some performance benchmarks between Encoders::Compressed::Gzip.encode(data) and Zlib.gzip to make sure the Zlib.gzip option is more performant
We appear to be using what I hypothesize is a fork of an older version of the Zlib gem's gzip compression logic to gzip our outbound payloads.
We should see if we can modernize our approach while retaining compatibility with all supported Ruby versions.
To gzip some data, we should need only to do this:
We may be able to replace the module
NewRelic::Agent::Encoders::Compressed::Gzip
with the code above. It is used inNewRelic::Agent::Service#compress_request_if_needed
Acceptance Criteria
Encoders::Compressed::Gzip.encode(data)
andZlib.gzip
to make sure theZlib.gzip
option is more performant