diff options
author | avstrakhov <57530959+avstrakhov@users.noreply.github.com> | 2022-01-19 18:57:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 17:57:49 +0200 |
commit | b003e5fd40c3b42dfacc87db5a7730b76eff0e92 (patch) | |
tree | da105b1b74c98cb567ff18aa73d282566bbff454 /configure.ac | |
parent | 8a01dabf89add0ef473d37bc8f2310cabfc1db43 (diff) |
Add code for LZ4 streaming data compression (#11821)
* Add code for LZ4 streaming data compression
* Fix LGTM alert
* Add lz4 library for link when compression enabled
* Add LZ4_resetStream_fast presence detection
* Disable compression for older LZ4 libraries
* Correct LZ4 API check
* [Testing Stream Compression] Debug msgs and report.md
* Add LZ4 library version using LZ4_initStream
* Fixed bug in SSL mode
* [Testing compression] - Add compression info messages
* Set compression enabled by default, update doc
* Update streaming/README.md
Co-authored-by: DShreve2 <david@netdata.cloud>
* [Agent Negotiation] Compression as separate capability
* [Agent Negotiation] Compression as separate capability - default compression variable always active
* Add code to negotiate compression
* [Agent Negotiation] Based on stream version
* [Agent Negotiation] Version based - fix compilation error
* [Agent Negotiation] Fix glob var default_compression_enbaled=0 affects all the connections - Handle compression - stream version based
* [Agent Negotiation - Compression] - Add control flag in 1. sender/receiver state & 2. stream.conf per child
* [Agent Negotiation - Compression] Fix stream.conf key, mguid control
* [Agent Negotiate Compression] Fine control on stream.conf per key,mguid for each child
* [Agent Negotiation Compression] Stop destroying compressor for runtime configuration + Update Readme.md
* [Agent Negotiation Compression] Use stream_version 4 if compression is disabled
* Correct child's compression check
* [Agent Negotiation Compression] Create streaming compression section in docs.
* [Agent Negotiation Compresion] Remove redundant debug msgs
* [Stream Compression] - integrate compression build info & config info in api/v1/info endpoint.
* [Agent Negotiation] Finalize README.md
* [Agent Stream Compression] Fix buildinfo json, Finalize readme.md
* [Agent Stream Compression] Negotiate compression based on stream version
* [Agent Stream Compression] Stream compression control per child in stream.conf | per AP_KEY, MACHINE_GUID
* [Agent Stream Compression] Avoid destroying compressor enabling runtime configuration + Update Readme.md
* [Agent Stream Compression] - Provide stream compression build info & config info in api/v1/info endpoint + Update Readme.md
* [Agent Stream Compression] Fix rebase conflicts
* [Agent Stream Compression] Fix more rebase conflicts
* [Agent Stream Compression] 1. Stream version based negotiation 2. per child stream.conf control 3. finalize docs 4. stream compression build info in web api
* [Agent Stream Compression] 1. Stream version based negotiation 2. per child stream.conf control 3. finalize docs 4. stream compression build info in web api
* [Agent Stream Compression] Change unsuccessful buffer check to error
* [Agent Stream Compression] Readme.md proof-read corrections, downgrade to stream_version_clabels, add shields for supported versions, EOF lint
* [Agent Stream Compression] Fix missed lz4 library on Alpine Linux
* Phrasal review
Co-authored-by: odynik <odynik.ee@gmail.com>
Co-authored-by: DShreve2 <david@netdata.cloud>
Co-authored-by: Tina Lüdtke <tina@kickoke.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index eae219fd69..1dc6c53acb 100644 --- a/configure.ac +++ b/configure.ac @@ -155,6 +155,12 @@ AC_ARG_ENABLE( [enable_https="detect"] ) AC_ARG_ENABLE( + [compression], + [AS_HELP_STRING([--enable-compression], [Enable LZ4 compression support @<:@default autodetect@:>@])], + , + [enable_compression="detect"] +) +AC_ARG_ENABLE( [dbengine], [AS_HELP_STRING([--disable-dbengine], [disable netdata dbengine @<:@default autodetect@:>@])], , @@ -357,11 +363,16 @@ OPTIONAL_UV_LIBS="${UV_LIBS}" AC_CHECK_LIB( [lz4], + [LZ4_initStream], + [LZ4_LIBS_FAST="-llz4"] +) + +AC_CHECK_LIB( + [lz4], [LZ4_compress_default], [LZ4_LIBS="-llz4"] ) - # ----------------------------------------------------------------------------- # zlib @@ -517,6 +528,37 @@ fi AC_MSG_RESULT([${enable_https}]) AM_CONDITIONAL([ENABLE_HTTPS], [test "${enable_https}" = "yes"]) +AC_MSG_CHECKING([if netdata compression should be used]) +if test "${enable_compression}" != "no"; then + if test "${LZ4_LIBS_FAST}"; then + LIBS_BKP="${LIBS}" + LIBS="${LZ4_LIBS_FAST}" + AC_TRY_LINK( + [ #include <lz4.h> ], + [ + LZ4_stream_t* stream = LZ4_initStream(NULL, 0); + ], + [ enable_compression="yes"], + [ enable_compression="no" ] + ) + LIBS="${LIBS_BKP}" + if test "${enable_compression}" == "yes"; then + OPTIONAL_LZ4_LIBS="${LZ4_LIBS_FAST}" + AC_DEFINE([ENABLE_COMPRESSION], [1], [netdata compression usability]) + fi + else + if test "${enable_compression}" == "yes"; then + AC_MSG_ERROR([liblz4 with version >= 1.9.0 required to enable_compression. Try installing the required version of 'liblz4-dev' or 'liblz4-devel'.]) + enable_compression="no" + fi + enable_compression="no" + fi +else + enable_compression="no" +fi +AC_MSG_RESULT([${enable_compression}]) +AM_CONDITIONAL([ENABLE_COMPRESSION], [test "${enable_compression}" = "yes"]) + # ----------------------------------------------------------------------------- # JSON-C |