diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2022-06-01 20:01:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-01 20:01:52 +0300 |
commit | 7784a16cc7af8260bb8877873a60d7dc6d2c9e73 (patch) | |
tree | 28964e18f97bfee01977240981fb53333f95bc7e /CMakeLists.txt | |
parent | c261a771cc0c93fe4e9fbb83e1be141406d314be (diff) |
Dictionary with JudyHS and double linked list (#13032)
* dictionary internals isolation
* more dictionary cleanups
* added unit test
* we should use DICT internally
* disable cups in cmake
* implement DICTIONARY with Judy arrays
* operational JUDY implementation
* JUDY cleanup
* JUDY summary added
* JudyHS implementation with double linked list
* test negative searches too
* optimize destruction
* optimize set to insert first without lookup
* updated stats
* code cleanup; better organization; updated info
* more code cleanup and commenting
* more cleanup, renames and comments
* fix rename
* more cleanups
* use Judy.h from system paths
* added foreach traversal; added flag to add item in front; isolated locks to their own functions; destruction returns the number of bytes freed
* more comments; flags are now 16-bit
* completed unittesting
* addressed comments and added reference counters maintainance
* added unittest in main; tested removal of items in front, back and middle
* added read/write walkthrough and foreach; allowed walkthrough and foreach in write mode to delete the current element (used by cups.plugin); referenced counters removed from the API
* DICTFE.name should be const too
* added API calls for exposing all statistics
* dictionary flags as enum and reference counters as atomic operations
* more comments; improved error handling at unit tests
* added functions to allow unsafe access while traversing the dictionary with locks in place
* check for libcups in cmake
* added delete callback; implemented statsd with this dictionary
* added missing dfe_done()
* added alternative implementation with AVL
* added documentation
* added comments and warning about AVL
* dictionary walktrhough on new code
* simplified foreach; updated docs
* updated docs
* AVL is much faster without hashes
* AVL should follow DBENGINE
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ed525fb52..cd5d68a8c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,6 +231,15 @@ pkg_check_modules(CURL libcurl) # ${CURL_INCLUDE_DIRS} # ----------------------------------------------------------------------------- +# Detect libcups + +pkg_check_modules(CURL libcups) +# later we use: +# ${CUPS_LIBRARIES} +# ${CUPS_CFLAGS_OTHER} +# ${CUPS_INCLUDE_DIRS} + +# ----------------------------------------------------------------------------- # Detect libaws-c-common find_library(HAVE_AWS_CHECKSUMS aws-checksums) @@ -491,6 +500,10 @@ set(SLABINFO_PLUGIN_FILES collectors/slabinfo.plugin/slabinfo.c ) +set(CUPS_PLUGIN_FILES + collectors/cups.plugin/cups_plugin.c + ) + set(EBPF_PROCESS_PLUGIN_FILES collectors/ebpf.plugin/ebpf.c collectors/ebpf.plugin/ebpf.h @@ -1229,6 +1242,12 @@ ELSE() SET(ENABLE_PLUGIN_XENSTAT False) ENDIF() +IF(CUPS_LIBRARIES) + SET(ENABLE_PLUGIN_CUPS True) +ELSE() + SET(ENABLE_PLUGIN_CUPS False) +ENDIF() + # ----------------------------------------------------------------------------- # netdatacli @@ -1338,6 +1357,20 @@ ENDIF() # ----------------------------------------------------------------------------- +# cups.plugin + +IF(ENABLE_PLUGIN_CUPS) + message(STATUS "cups.plugin: enabled") + add_executable(cups.plugin config.h ${CUPS_PLUGIN_FILES}) + target_link_libraries (cups.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${CUPS_LIBRARIES}) + target_include_directories(cups.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${CUPS_INCLUDE_DIRS}) + target_compile_options(cups.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${CUPS_CFLAGS_OTHER}) +ELSE() + message(STATUS "cups.plugin: disabled") +ENDIF() + + +# ----------------------------------------------------------------------------- # cgroup-network IF(ENABLE_PLUGIN_CGROUP_NETWORK) |