0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-17 03:02:41 +00:00
Commit graph

39 commits

Author SHA1 Message Date
Andrew Clayton
adb7026b14 Make use of GCC's __attribute__((unused)) ()
* configure.ac: Add support for GCC's __attribute__((unused))

When compiling under GCC with -Wextra (along with -Wall) there are a lot
of compiler warnings such as

collectors/cgroups.plugin/cgroup-network.c:89:45: warning: unused parameter ‘scope’ [-Wunused-parameter]
   89 | struct iface *read_proc_net_dev(const char *scope, const char *prefix) {
      |                                 ~~~~~~~~~~~~^~~~~

Some arguments may be able to be got rid off, others won't.

GCC (and at least clang[0]) provide an __attribute__((unused))
annotation that can be used on function parameters (also on variables,
functions, labels, enums, structs etc) to inform the compiler of such
and will squash warnings of the above nature.

A check is added to configure.ac for the use of GCC (I believe $GCC will
be set to 'yes' for clang also) and if found it creates __always_unused
& __maybe_unused #define's set to __attribute__((unused)) otherwise it
just sets them empty.

If other compilers have a similar feature this check can be adjusted to
accommodate them.

The reason for the two defines is that some variables may always be
unused in a function, others may or may not depending on #ifdef's for
example. So we are able to document both cases.

Subsequent commits will start making use of these to squash such
compiler warnings.

[0]: https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* collectors/statsd.plugin: Mark a function argument as __maybe_unused

In collectors/statsd.plugin/statsd.c the app function argument to
STATSD_APP_CHART_DIM() might be unused if NETDATA_INTERNAL_CHECKS is not
defined, then the debug() macro that it's used in from
libnetdata/log/log.h will be defined to a dummy function where none of
the arguments are used.

This fixes a compiler warning [-Wunused-parameter] when compiling with
-Wextra *and* -Wall.

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* collectors/apps.plugin: Mark a function argument as __maybe_unused

In collectors/apps.plugin/apps_plugin.c the function
debug_print_process_tree() takes an argument 'msg' that might be unused
if NETDATA_INTERNAL_CHECKS is not defined, then debug_log() will be set
to a dummy function that takes no arguments.

This fixes a compiler warning [-Wunused-parameter] when compiling with
-Wextra *and* -Wall.

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* libnetdata/locks/locks: Mark function arguments as __maybe_unused

In libnetdata/locks/locks.c there a number of functions that take
arguments 'file', 'function' & 'line' that might be unused if
NETDATA_INTERNAL_CHECKS is not defined, then the debug() macro that it's
used in from libnetdata/log/log.h will be defined to a dummy function
where none of the arguments are used.

This fixes compiler warnings [-Wunused-parameter] when compiling with
-Wextra *and* -Wall.

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* libnetdata/socket/security: Mark a function argument as __maybe_unused

In libnetdata/socket/security.c the function security_info_callback()
takes an argument 'ret' that might be unused if NETDATA_INTERNAL_CHECKS
is not defined, then the debug() macro that it's used in from
libnetdata/log/log.h will be defined to a dummy function where none of
the arguments are used.

This fixes a compiler warning [-Wunused-parameter] when compiling with
-Wextra *and* -Wall.

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* collectors/cgroups.plugin: Mark a function argument as __maybe_unused

In collectors/cgroups.plugin/cgroup-network.c the function
read_proc_net_dev() takes an argument 'scope' that might be unused if
the NETDATA_INTERNAL_CHECKS is not defined.

This fixes a compiler warning [-Wunused-parameter] when compiling with
-Wextra *and* -Wall".

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* database/rrddim: Mark function arguments as __maybe_unused

In database/rrddim.c there a couple of functions that take a 'st'
argument that might be unused if NETDATA_INTERNAL_CHECKS is not defined,
then the debug() macro that it's used in from libnetdata/log/log.h will
be defined to a dummy function where none of the arguments are used.

This fixes compiler warnings [-Wunused-parameter] when compiling with
-Wextra *and* -Wall.

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>

* database/rrdvar: Mark a function argument as __maybe_unused

In database/rrdvar.c the function rrdvar_create_and_index() take an
argument 'scope' that might be unused if NETDATA_INTERNAL_CHECKS is not
defined, then the debug() macro that it's used in from
libnetdata/log/log.h will be defined to a dummy function where none of
the arguments are used.

This fixes a compiler warning [-Wunused-parameter] when compiling with
-Wextra *and* -Wall.

Signed-off-by: Andrew Clayton <andrew@zeta.digital-domain.net>
2019-07-23 14:12:41 +02:00
Markos Fountoulakis
192a868b03 Fix CRC and I/O error handling in dbengine so that netdata is not halted and relevant error messages are printed and alarms are raised () 2019-07-15 09:07:55 +02:00
thiagoftsm
80b70d37f2 Health_index ()
Inside rrdcalc_unlink_and_free I wrote a not proper way to check the presence
of an element inside the AVL, so I was raising an error without to do the correct checks!
2019-07-05 12:45:17 +02:00
Markos Fountoulakis
9dc6cdd72c
Update README.md ()
Improve documentation about file descriptors and systemd configuration.
2019-07-02 15:47:36 +03:00
thiagoftsm
dd73f3e0cd
Repeating alarm notifications ()
* Alarm_repeat mergin the original!

* Alarm_repeat binary tree!

* Alarm_repeat binary tree finished!

* Alarm_repeat move function and format string

* Alarms bringing a new Binary tree

* Alarms fixing the last two

* Alarm_repeat useless var!

* Alarm fix format and repeat alarm!

* Alarm_backend steps!

* Alarm_repeat stopping to test cloud!

* Alarm_repeat stopping to test cloud 2!

* Alarm_repeat fixing when restart!
2019-07-01 11:55:16 +00:00
Markos Fountoulakis
965ae842f3
Update documentation about dbengine ()
* Update README.md with more up-to-date information regarding dbengine
2019-06-21 13:31:03 +03:00
Markos Fountoulakis
6312080b69
Handle file descriptors running out ()
* Handle file descriptors running out

* Added alarm for dbengine FS and I/O errors

* more verbose alarm message

* * Added File-Descriptor budget to Database Engine instances.
* Changed FD budget of the web server from 50% to 25%.
* Allocated 25% of FDs to dbengine.
* Created a new dbengine global FD utilization chart.
2019-06-21 12:52:58 +03:00
Vladimir Kobal
8a1a437e75
Chart name streaming ()
* Update name when it is changed

* Add info about custom chart names on slaves
2019-06-19 09:32:32 +03:00
Markos Fountoulakis
f3edd43b4f Force page alignment per dimension of chart. () 2019-06-07 12:06:33 +02:00
Vladimir Kobal
77781d033d Prometheus remote write backend ()
* Add Prometheus remote write backend prototype

* Fix autotools issues

* Send HTTP POST request

* Add parameters to HTTP header

* Discard HTTP responce 200

* Update CMake build configuration

* Fix Codacy issue

* Check for C++ binary

* Fix compilation without remote write backend

* Add options to the installer script

* Fix configure script warning

* Fix make dist

* Downgrade to ByteSize for better compatibility

* Integrate remote write more tightly into the existing backends code

* Cleanup

* Fix build error

* Parse host tags

* Fix Codacy issue

* Fix counters for buffered data

* Rename preprocessor symbol

* Better error handling

* Cleanup

* Update the documentation
2019-06-07 10:48:32 +02:00
Markos Fountoulakis
118534bd8b Fill chart gaps efficiently. () 2019-06-04 17:20:38 +02:00
Markos Fountoulakis
2f7b222ff1 Fix page cache descriptor race condition () 2019-06-04 10:00:44 +02:00
Markos Fountoulakis
dee923850b Support falling back to buffered I/O when direct I/O is unavailable () 2019-06-03 14:26:16 +02:00
Markos Fountoulakis
5a89b3f934 Change print level from error to info () 2019-06-03 14:25:30 +02:00
thiagoftsm
b6088e08a7 SSL implementation for Netdata ()
* SSL implementation for Netdata

* Upload of fixes asked by @paulkatsoulakis and @cakrit

* Fix local computer

* Adding openssl to webserver

* fixing..

* HTTPS almost there

* Codacity

* HTTPS day 3

* HTTPS without Bio step 1

* HTTPS without Bio step 2

* HTTPS without Bio step 3

* HTTPS without Bio step 4

* HTTPS without Bio step 5

* HTTPS without Bio step 6

* HTTPS without Bio step 7

* HTTPS without Bio step 8

* HTTPS without Bio step 9

* HTTPS without Bio step 10

* SSL on streaming 1

* Daily pull

* HTTPS without Bio step 11

* HTTPS without Bio step 12

* HTTPS without Bio step 13

* HTTPS without Bio step 14

* SSL_Interception change documentation

* HTTPS without Bio step 15

* HTTPS without Bio step 16

* SSL_Interception fix codacity

* SSL_Interception fix doc

* SSL_Interception comments

* SSL_Interception fixing problems!

* SSL_Interception killing bugs

* SSL_Interception changing parameter

* SSL_Implementation documentation and script

* SSL_Implementation multiple fixes

* SSL_Implementation installer and cipher

* SSL_Implementation Redirect 301

* SSL_Implementation webserver doc and install-or-update.sh

* SSL_Implementation error 00000001:lib(0):func(0):reason(1)

* SSL_Implementation web server doc

* SSL_Implementation SEGFAULT on Fedora

* SSL_Implementation fix ^SSL=force|optional

* SSL_Implementation Redirect and Ciphers

* SSL_Implementation race condition 1

* SSL_Implementation Fix Location

* SSL_Implementation Fix Location 2

* SSL_Implementation Fix stream

* SSL_Implementation Fix stream 2

* SSL_Implementation Fix stream 3

* SSL_Implementation last problems!

* SSL_Implementation adjusts to commit!

* SSL_Implementation documentation permission!

* SSL_Implementation documentation permission 2!

* SSL_Implementation documentation permission 3!
2019-05-31 16:27:35 +02:00
Markos Fountoulakis
2f72bfafba Add empty page detection in DB engine () 2019-05-30 14:27:45 +02:00
Markos Fountoulakis
caf7b19194 DB engine optimize RAM usage ()
* Optimize memory footprint of DB engine

* Update documentation with the new memory requirements of dbengine

* Fixed code style

* Fix code style

* Fix compile error
2019-05-30 11:09:26 +02:00
Chris Akritidis
9410b63ee9
Remove unecessary 2nd call of get_system_info at startup () 2019-05-27 10:30:15 +02:00
Vladimir Kobal
7ac912b5ba Remove system_info copying ()
* Remove system_info copying

* Return res flag
2019-05-24 17:18:00 +03:00
Markos Fountoulakis
908d5c78fa Fix race condition in DB engine API () 2019-05-22 12:27:54 +02:00
Markos Fountoulakis
c065099bfe Fix creating chart directories when not necessary with memory mode dbengine () 2019-05-22 11:44:00 +02:00
Markos Fountoulakis
06e16acdb0 Fix delete datafile error ()
* Added print to debug failure to delete page during datafile deletion

* Detect case of corrupted pages not being in page cache when deleting file
2019-05-20 21:31:56 +03:00
Markos Fountoulakis
6ca6d840dd Database engine ()
* Database engine prototype version 0

* Database engine initial integration with netdata POC

* Scalable database engine with file and memory management.

* Database engine integration with netdata

* Added MIN MAX definitions to fix alpine build of travis CI

* Bugfix for backends and new DB engine, remove useless rrdset_time2slot() calls and erroneous checks

* DB engine disk protocol correction

* Moved DB engine storage file location to /var/cache/netdata/{host}/dbengine

* Fix configure to require openSSL for DB engine

* Fix netdata daemon health not holding read lock when iterating chart dimensions

* Optimized query API for new DB engine and old netdata DB fallback code-path

* netdata database internal query API improvements and cleanup

* Bugfix for DB engine queries returning empty values

* Added netdata internal check for data queries for old and new DB

* Added statistics to DB engine and fixed memory corruption bug

* Added preliminary charts for DB engine statistics

* Changed DB engine ratio statistics to incremental

* Added netdata statistics charts for DB engine internal statistics

* Fix for netdata not compiling successfully when missing dbengine dependencies

* Added DB engine functional test to netdata unittest command parameter

* Implemented DB engine dataset generator based on example.random chart

* Fix build error in CI

* Support older versions of libuv1

* Fixes segmentation fault when using multiple DB engine instances concurrently

* Fix memory corruption bug

* Fixed createdataset advanced option not exiting

* Fix for DB engine not working on FreeBSD

* Support FreeBSD library paths of new dependencies

* Workaround for unsupported O_DIRECT in OS X

* Fix unittest crashing during cleanup

* Disable DB engine FS caching in Apple OS X since O_DIRECT is not available

* Fix segfault when unittest and DB engine dataset generator don't have permissions to create temporary host

* Modified DB engine dataset generator to create multiple files

* Toned down overzealous page cache prefetcher

* Reduce internal memory fragmentation for page-cache data pages

* Added documentation describing the DB engine

* Documentation bugfixes

* Fixed unit tests compilation errors since last rebase

* Added note to back-up the DB engine files in documentation

* Added codacy fix.

* Support old gcc versions for atomic counters in DB engine
2019-05-15 08:28:06 +03:00
Vladimir Kobal
0d5fa83e22
Fix segmentation fault ()
* Fix segmentation fault

* Make system info printing safe

* Fix quotes for OS name
2019-05-14 18:35:12 +03:00
Vladimir Kobal
51decad989 Add system info streaming ()
* Add system info streaming

* Fix segmentation fault in unit testing
2019-05-13 14:12:25 +02:00
Vladimir Kobal
30e49cdc15 Fix nonobsolete dimension deletion () 2019-03-11 10:36:05 +01:00
Paul Katsoulakis
b812d23e32
Minor fixes around plugin_directories initialization ()
* Daemon minor cleanups: 
  1) pull in plugin directories logic, inside the pluginsd where it belongs and call a method from the daemon to do so, 
  2) Magic numbers are evil, give a meaningful definition for that plugin directories retrieval

* Rename netdata_configured_plugins_dir -> netdata_configured_primary_plugins_dir. We allow multiple plugin directories and this is actually the primary (or stock?) directory, just make it clear to avoid confusion

* In this new wrapper, just return whatever the string splitter would return

* Reduce the scope - consider moving this to somewhere else in a common place if needed by other modules later
2019-03-05 10:10:09 +00:00
Vladimir Kobal
2f6f8155db
Add message queue statistics ()
* Add IPC message queue charts

* Add obsolete flag for dimensions

* Delete obsolete dimensions from memory

* Remove files for obsolete dimensions, filter requests

* Make empty charts obsolete

* Minimize obsolete dimension checks

* Limit the number of dimensions in memory

* Remove obsolete dimensions on netdata exit

* Update documentation

* Move flag to the end

* Fix typo

* Fix typo
2019-02-11 13:24:24 +02:00
Chris Akritidis
08649bec37
Port ACLs, Management API and Health commands ()
##### Summary
fixes  
fixes 
fixes  
fixes  
fixes  
fixes 

Implements a command API for health which will accept commands via a socket to selectively suppress health checks. 

Allows different ports to accept different request types  (streaming, dashboard, api, registry, netdata.conf, badges, management)

Removes support for multi-threaded and single-threaded web servers.

##### Component Name
health, daemon
2019-01-15 12:49:28 +01:00
Chris Akritidis
415f57c5bf
Ga ()
* Added GA tags to markdowns

* Add GA tags to mds
2018-12-07 11:30:04 +01:00
Chris Akritidis
1149ce3240 Sanitize headers and htmlstructure ()
* Restructured html site, corrected header in REDISTRIBUTED

* Added header

* Header updates and restructuring

* Move requirements and runtime txts to htmldoc, by adding a netlify.toml that changes the base directory

* Minor corrections to support the html doc restructuring

* Debugging netlify

* Debugging netlify

* Debugging netlify

* Beautify headers, comment in buildhtml

* Beautify headers

* Sanitize headers and reorganize static html site

* Updated Makefile with moved and created htmldoc scripts
2018-11-23 01:16:56 +02:00
Costa Tsaousis
ee1b7ef695
fixed max interface speed calculation () 2018-11-10 00:55:30 +02:00
George Moschovitis
112924d4e7 Minor documentation improvements ()
* Formatting updates in database/README.md

* More formarring in README.md files

* README.md formatting

* Minor formatting change

* Minor changes in registy/README.md

* Minor formatting

* Minor formatting change
2018-11-08 00:53:19 +02:00
Costa Tsaousis
36199f4498
incremental overflows should not show zeros values ()
* incremental overflows do not show zeros; fixes 

* use the max per metric per session for detecting counter size
2018-11-04 21:53:19 +02:00
Costa Tsaousis
f739ab110b
allow debugging memory per module ()
* debug info

* removed debug code
2018-10-30 23:14:35 +02:00
Costa Tsaousis
bcdfedbe82
fixed rpm build; () 2018-10-26 20:34:48 +03:00
Costa Tsaousis
09e89e937a
modularize the query api ()
* modularized exporters

* modularized API data queries

* optimized queries

* modularized API data reduction methods

* modularized api queries

* added new directories in makefiles

* added median db query

* moved all RRDR_GROUPING related to query.h

* added stddev query

* operational median and stddev

* working simple exponential smoothing

* too complex to do it right

* fixed ses

* fixed ses

* rewrote query engine

* fix double-exponential-smoothing

* cleanup

* fixed bug identified by @vlvkobal at rrdset_first_slot()

* enable freeipmi on systems with libipmimonitoring; 
2018-10-23 00:38:04 +03:00
Costa Tsaousis
e76aac74e6
moved related wiki pages into the repo ()
* moved related wiki pages into the repo

* updated web server docs

* fixed typos
2018-10-18 17:31:52 +03:00
Costa Tsaousis
8fbf817ef8
modularized all source code ()
* modularized all external plugins

* added README.md in plugins

* fixed title

* fixed typo

* relative link to external plugins

* external plugins configuration README

* added plugins link

* remove plugins link

* plugin names are links

* added links to external plugins

* removed unecessary spacing

* list to table

* added language

* fixed typo

* list to table on internal plugins

* added more documentation to internal plugins

* moved python, node, and bash code and configs into the external plugins

* added statsd README

* fix bug with corrupting config.h every 2nd compilation

* moved all config files together with their code

* more documentation

* diskspace info

* fixed broken links in apps.plugin

* added backends docs

* updated plugins readme

* move nc-backend.sh to backends

* created daemon directory

* moved all code outside src/

* fixed readme identation

* renamed plugins.d.plugin to plugins.d

* updated readme

* removed linux- from linux plugins

* updated readme

* updated readme

* updated readme

* updated readme

* updated readme

* updated readme

* fixed README.md links

* fixed netdata tree links

* updated codacy, codeclimate and lgtm excluded paths

* update CMakeLists.txt

* updated automake options at top directory

* libnetdata slit into directories

* updated READMEs

* updated READMEs

* updated ARL docs

* updated ARL docs

* moved /plugins to /collectors

* moved all external plugins outside plugins.d

* updated codacy, codeclimate, lgtm

* updated README

* updated url

* updated readme

* updated readme

* updated readme

* updated readme

* moved api and web into webserver

* web/api web/gui web/server

* modularized webserver

* removed web/gui/version.txt
2018-10-15 23:16:42 +03:00