0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-16 18:37:50 +00:00
Commit graph

14396 commits

Author SHA1 Message Date
Costa Tsaousis
cb7af25c09
RRD structures managed by dictionaries ()
* rrdset - in progress

* rrdset optimal constructor; rrdset conflict

* rrdset final touches

* re-organization of rrdset object members

* prevent use-after-free

* dictionary dfe supports also counting of iterations

* rrddim managed by dictionary

* rrd.h cleanup

* DICTIONARY_ITEM now is referencing actual dictionary items in the code

* removed rrdset linked list

* Revert "removed rrdset linked list"

This reverts commit 690d6a588b4b99619c2c5e10f84e8f868ae6def5.

* removed rrdset linked list

* added comments

* Switch chart uuid to static allocation in rrdset
Remove unused functions

* rrdset_archive() and friends...

* always create rrdfamily

* enable ml_free_dimension

* rrddim_foreach done with dfe

* most custom rrddim loops replaced with rrddim_foreach

* removed accesses to rrddim->dimensions

* removed locks that are no longer needed

* rrdsetvar is now managed by the dictionary

* set rrdset is rrdsetvar, fixes https://github.com/netdata/netdata/pull/13646#issuecomment-1242574853

* conflict callback of rrdsetvar now properly checks if it has to reset the variable

* dictionary registered callbacks accept as first parameter the DICTIONARY_ITEM

* dictionary dfe now uses internal counter to report; avoided excess variables defined with dfe

* dictionary walkthrough callbacks get dictionary acquired items

* dictionary reference counters that can be dupped from zero

* added advanced functions for get and del

* rrdvar managed by dictionaries

* thread safety for rrdsetvar

* faster rrdvar initialization

* rrdvar string lengths should match in all add, del, get functions

* rrdvar internals hidden from the rest of the world

* rrdvar is now acquired throughout netdata

* hide the internal structures of rrdsetvar

* rrdsetvar is now acquired through out netdata

* rrddimvar managed by dictionary; rrddimvar linked list removed; rrddimvar structures hidden from the rest of netdata

* better error handling

* dont create variables if not initialized for health

* dont create variables if not initialized for health again

* rrdfamily is now managed by dictionaries; references of it are acquired dictionary items

* type checking on acquired objects

* rrdcalc renaming of functions

* type checking for rrdfamily_acquired

* rrdcalc managed by dictionaries

* rrdcalc double free fix

* host rrdvars is always needed

* attempt to fix deadlock 1

* attempt to fix deadlock 2

* Remove unused variable

* attempt to fix deadlock 3

* snprintfz

* rrdcalc index in rrdset fix

* Stop storing active charts and computing chart hashes

* Remove store active chart function

* Remove compute chart hash function

* Remove sql_store_chart_hash function

* Remove store_active_dimension function

* dictionary delayed destruction

* formatting and cleanup

* zero dictionary base on rrdsetvar

* added internal error to log delayed destructions of dictionaries

* typo in rrddimvar

* added debugging info to dictionary

* debug info

* fix for rrdcalc keys being empty

* remove forgotten unlock

* remove deadlock

* Switch to metadata version 5 and drop
  chart_hash
  chart_hash_map
  chart_active
  dimension_active
  v_chart_hash

* SQL cosmetic changes

* do not busy wait while destroying a referenced dictionary

* remove deadlock

* code cleanup; re-organization;

* fast cleanup and flushing of dictionaries

* number formatting fixes

* do not delete configured alerts when archiving a chart

* rrddim obsolete linked list management outside dictionaries

* removed duplicate contexts call

* fix crash when rrdfamily is not initialized

* dont keep rrddimvar referenced

* properly cleanup rrdvar

* removed some locks

* Do not attempt to cleanup chart_hash / chart_hash_map

* rrdcalctemplate managed by dictionary

* register callbacks on the right dictionary

* removed some more locks

* rrdcalc secondary index replaced with linked-list; rrdcalc labels updates are now executed by health thread

* when looking up for an alarm look using both chart id and chart name

* host initialization a bit more modular

* init rrdlabels on host update

* preparation for dictionary views

* improved comment

* unused variables without internal checks

* service threads isolation and worker info

* more worker info in service thread

* thread cancelability debugging with internal checks

* strings data races addressed; fixes https://github.com/netdata/netdata/issues/13647

* dictionary modularization

* Remove unused SQL statement definition

* unit-tested thread safety of dictionaries; removed data race conditions on dictionaries and strings; dictionaries now can detect if the caller is holds a write lock and automatically all the calls become their unsafe versions; all direct calls to unsafe version is eliminated

* remove worker_is_idle() from the exit of service functions, because we lose the lock time between loops

* rewritten dictionary to have 2 separate locks, one for indexing and another for traversal

* Update collectors/cgroups.plugin/sys_fs_cgroup.c

Co-authored-by: Vladimir Kobal <vlad@prokk.net>

* Update collectors/cgroups.plugin/sys_fs_cgroup.c

Co-authored-by: Vladimir Kobal <vlad@prokk.net>

* Update collectors/proc.plugin/proc_net_dev.c

Co-authored-by: Vladimir Kobal <vlad@prokk.net>

* fix memory leak in rrdset cache_dir

* minor dictionary changes

* dont use index locks in single threaded

* obsolete dict option

* rrddim options and flags separation; rrdset_done() optimization to keep array of reference pointers to rrddim;

* fix jump on uninitialized value in dictionary; remove double free of cache_dir

* addressed codacy findings

* removed debugging code

* use the private refcount on dictionaries

* make dictionary item desctructors work on dictionary destruction; strictier control on dictionary API; proper cleanup sequence on rrddim;

* more dictionary statistics

* global statistics about dictionary operations, memory, items, callbacks

* dictionary support for views - missing the public API

* removed warning about unused parameter

* chart and context name for cloud

* chart and context name for cloud, again

* dictionary statistics fixed; first implementation of dictionary views - not currently used

* only the master can globally delete an item

* context needs netdata prefix

* fix context and chart it of spins

* fix for host variables when health is not enabled

* run garbage collector on item insert too

* Fix info message; remove extra "using"

* update dict unittest for new placement of garbage collector

* we need RRDHOST->rrdvars for maintaining custom host variables

* Health initialization needs the host->host_uuid

* split STRING to its own files; no code changes other than that

* initialize health unconditionally

* unit tests do not pollute the global scope with their variables

* Skip initialization when creating archived hosts on startup. When a child connects it will initialize properly

Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Co-authored-by: Vladimir Kobal <vlad@prokk.net>
2022-09-19 23:46:13 +03:00
Ilya Mashchenko
6224602916
bump go.d.plugin v0.40.0 () 2022-09-19 16:55:51 +03:00
Ilya Mashchenko
d6995cabcf
feat(health): add Postgres alarms () 2022-09-19 15:26:43 +03:00
netdatabot
8c3c83d528 [ci skip] Update changelog and version for nightly build: v1.36.0-122-nightly. 2022-09-19 00:17:57 +00:00
Ilya Mashchenko
28f55f6614
remove _instance_family label () 2022-09-18 19:44:44 +03:00
netdatabot
4e57cd9be7 [ci skip] Update changelog and version for nightly build: v1.36.0-120-nightly. 2022-09-17 00:19:09 +00:00
Costa Tsaousis
6a82d7bd25
fix typo not deleting collected flag; force removing collected flag on child disconnect () 2022-09-16 16:45:59 +03:00
Ilya Mashchenko
d70640d880
add proxysql dashboard info () 2022-09-16 16:08:41 +03:00
netdatabot
83bb5d4a1b [ci skip] Update changelog and version for nightly build: v1.36.0-117-nightly. 2022-09-16 00:20:20 +00:00
Stelios Fragkakis
2655a48922
Additional sqlite statistics ()
* Add sqlite page cache hit/ miss statistics

* Proper function calls

Co-authored-by: Vladimir Kobal <vlad@prokk.net>

* Additional sqlite statistics

Co-authored-by: Vladimir Kobal <vlad@prokk.net>
2022-09-15 17:29:34 +03:00
netdatabot
2cf7803a64 [ci skip] Update changelog and version for nightly build: v1.36.0-115-nightly. 2022-09-15 00:18:12 +00:00
Stelios Fragkakis
b629d3e310
Advance the buffer properly to scan the journal file () 2022-09-14 19:24:32 +03:00
Stelios Fragkakis
466b1fcc56
Add sqlite page cache hit and miss statistics ()
* Add sqlite page cache hit/ miss statistics

* Proper function definition

Co-authored-by: Vladimir Kobal <vlad@prokk.net>

* Proper function calls

Co-authored-by: Vladimir Kobal <vlad@prokk.net>

Co-authored-by: Vladimir Kobal <vlad@prokk.net>
2022-09-14 19:22:25 +03:00
Ilya Mashchenko
c93e585f38
adjust systemdunits alarms () 2022-09-14 15:12:06 +03:00
Ilya Mashchenko
0871f65a18
update Postgres dashboard info () 2022-09-14 15:11:50 +03:00
Ilya Mashchenko
7bdf7977fa
bump go.d.plugin to v0.39.0 () 2022-09-14 15:11:37 +03:00
Stelios Fragkakis
3b4fc558e1
Use mmap if possible during startup for journal replay ()
Try to mmap the journal files during replay. If the mmap fails, fallback to the old way
2022-09-14 13:00:31 +03:00
netdatabot
0682a6957d [ci skip] Update changelog and version for nightly build: v1.36.0-108-nightly. 2022-09-14 00:21:25 +00:00
Netdata bot
27cba68208
Update dashboard to version v2.29.0. ()
Co-authored-by: netdatabot <netdatabot@users.noreply.github.com>
2022-09-13 10:25:31 +03:00
netdatabot
0cba8476c9 [ci skip] Update changelog and version for nightly build: v1.36.0-106-nightly. 2022-09-13 00:18:58 +00:00
Vladimir Kobal
3d9b387838
Fix container virtualization info () 2022-09-12 16:22:43 +02:00
netdatabot
f065825807 [ci skip] Update changelog and version for nightly build: v1.36.0-104-nightly. 2022-09-10 00:18:40 +00:00
Timotej S
0c8c34955e
CMake improvements part 1 ()
* generate basic config.h
2022-09-09 15:09:20 +02:00
netdatabot
34613b88fe [ci skip] Update changelog and version for nightly build: v1.36.0-102-nightly. 2022-09-09 00:19:23 +00:00
vkalintiris
65f08f3d33
Do not free AR dimensions from within ML. ()
Do not free AR dimension from ML.
2022-09-09 00:55:16 +03:00
Stelios Fragkakis
e6870f0e8f
Improve agent shutdown time ()
* Remove dbengine statistics on shutdown since this is now provided by the /api/v1/dbengine_stats endpoint
Skip the memory cleanup if the agent is shutting down and not compiled with NETDATA_INTERNAL_CHECKS

* Report database tier as the event loop is shutting down

* Remove not-useful pointer report in the logfile
2022-09-08 23:45:05 +03:00
Ilya Mashchenko
8a5e713428
add _collect_job label to python.d/* charts () 2022-09-08 17:35:38 +03:00
netdatabot
9b493a3c1b [ci skip] Update changelog and version for nightly build: v1.36.0-98-nightly. 2022-09-08 00:20:11 +00:00
Stelios Fragkakis
f0b19a4a22
Fix a memory leak on archived host creation ()
When creating an archived host do not initialize labels (it is done already after host creation)
2022-09-07 23:13:03 +03:00
Costa Tsaousis
642e00348d
fix rrdcontexts left in the post-processing queue from the garbage collector ()
* fix rrdcontexts left in the post-processing queue from the garbage collector

* set the queuing flags atomically, using the dictionary callbacks
2022-09-07 23:02:09 +03:00
thiagoftsm
2cb23d5b81
eBPF different improvements () 2022-09-07 17:02:18 +00:00
Austin S. Hemmelgarn
df83a1e5c2
apps.plugin: Re-add chrome to the webbrowser group. () 2022-09-07 19:49:38 +03:00
Austin S. Hemmelgarn
ae1dac3978
Deaggregate the gui and email app groupx and improve GUI coverage. ()
* Deaggregate the `gui` and `email` app groupx and improve GUI coverage.

This splits the `gui` and `email` groups in the apps plugin config into a
number of much smaller and more descriptive groups, as well as expanding
what we cover for a number of the resultant groups. In particular:

- The `email` group has been explicitly split into two separate groups,
  `mta` for mail transfer agents (SMTP servers), and `mda` for mail
  delivery agents (IMAP/POP3 servers). The new `mda` group prrovides
  slightly better coverage of MDA software than the old `email` group did.
- A new `mua` group has been added for email clients (formally Mail User
  Agents), covering Evolution, Thunderbird, and a selection of popular
  console email clients.
- A new `ntfs` group has been created, matching on NTFS-3G. This
  particular software is in relatively widespread usage on Linux desktop
  systems, and does not generally get automatically matched by the `gui`
  group.
- A re-added `X` group covers _only_ X11, XDM, Xwayland, and xsettingsd.
- A new `wayland` group covers a handful of tools commonly used with
  Wayland independent of the choice of compositor.
- A new `kde` group covers all of the standard KDE 5 and Plasma tooling,
  including some things we were previously not matching correctly that
  may not be in the process tree of the KDE session itself.
- New groups also cover the GNOME, MATE, Cinnamon, XFCE4, LXDE, LXQt,
  and Enlightenment desktop environments.
- New groups have been added to cover i3, DWM, and AwesomeWM, three of
  the most popular X11 window managers on Linux.
- New groups have been added to cover Sway, Wayfire, Cage, and Westom,
  four commonly used Wayland compositors.
- The `gui` group is retained, matching on GUI specific tooling that is
  not DE/Compositor specific. It has also been expanded to include a
  couple of additional components we were not matching on previously,
  such as the XDG portal tooling.
- A new `webbrowser` group has been added, covering the most common web
  browsers on Linux (including some widely used text-mode browsers).
- RTKit and gpg-agent have both been added to the system group. Both are
  relatively commonly used on Linux desktop systems, but are not GUI
  specific.

* Add text mode browsers.

Somehow got missed in the original commit.

* Add USBGuard to system group.

* Add links to the webbrowser group.
2022-09-07 10:47:41 -04:00
Costa Tsaousis
d36aa21fda
fix compile issues () 2022-09-07 16:54:20 +03:00
Costa Tsaousis
b8d1ae8de7
Updated tc.plugin (linux bandwidth QoS) ()
* modernized tc plugins (replacing AVL with DICTIONARY, char * with STRING *, linked list with DICTIONARY) and added labels

* replace custom metrics with worker metrics and add monitoring number of devices and classes

* revert bool to char

* Revert "revert bool to char"

This reverts commit fae9b92dc0.

* fixed typo

* removed bitfield from bool

* commented unused function

* commented unused function again
2022-09-07 16:48:13 +03:00
Costa Tsaousis
3f6a75250d
Obsolete RRDSET state ()
* move chart_labels to rrdset

* rename chart_labels to rrdlabels

* renamed hash_id to uuid

* turned is_ar_chart into an rrdset flag

* removed rrdset state

* removed unused senders_connected member of rrdhost

* removed unused host flag RRDHOST_FLAG_MULTIHOST

* renamed rrdhost host_labels to rrdlabels

* Update exporting unit tests

Co-authored-by: Vladimir Kobal <vlad@prokk.net>
2022-09-07 15:28:30 +03:00
netdatabot
17e0676b5b [ci skip] Update changelog and version for nightly build: v1.36.0-89-nightly. 2022-09-07 00:16:58 +00:00
Stelios Fragkakis
b16df94494
Fix worker utilization cleanup () 2022-09-07 00:37:35 +03:00
Costa Tsaousis
c7d2732ebf
remove forgotten avl structure from rrdcalc () 2022-09-06 23:38:48 +03:00
Costa Tsaousis
58c79fd329
Faster rrdcontext ()
* moved rrdcontexts processing to worker thread

* added loggings

* check for aclk deeper in the code

* removed unessesary logs

* code re-organization; cleanup; more comments; better error handling; rrdcontext locks optimization; more clarity

* updated 2 comments

* make instances walkthrough reentrant; move context lock to the place is really needed

* created macro for reentrant dictionary walkthrough

* incremental updates on instances and metrics

* renamed family of rrdcontext workers

* prevent crash in case RRDINSTANCE or RRDMETRIC is freed during shutdown

* prevent crash during rrddim save, on out of memory fatal()

* always post-process contexts

* added tracing for tracking the caller that trigger updates

* more details on tracing info

* fix for charts that are collected without metrics
2022-09-06 19:02:39 +03:00
netdatabot
64a6920038 [ci skip] Update changelog and version for nightly build: v1.36.0-85-nightly. 2022-09-06 00:17:04 +00:00
Costa Tsaousis
5e1b95cf92
Deduplicate all netdata strings ()
* rrdfamily

* rrddim

* rrdset plugin and module names

* rrdset units

* rrdset type

* rrdset family

* rrdset title

* rrdset title more

* rrdset context

* rrdcalctemplate context and removal of context hash from rrdset

* strings statistics

* rrdset name

* rearranged members of rrdset

* eliminate rrdset name hash; rrdcalc chart converted to STRING

* rrdset id, eliminated rrdset hash

* rrdcalc, alarm_entry, alert_config and some of rrdcalctemplate

* rrdcalctemplate

* rrdvar

* eval_variable

* rrddimvar and rrdsetvar

* rrdhost hostname, os and tags

* fix master commits

* added thread cache; implemented string_dup without locks

* faster thread cache

* rrdset and rrddim now use dictionaries for indexing

* rrdhost now uses dictionary

* rrdfamily now uses DICTIONARY

* rrdvar using dictionary instead of AVL

* allocate the right size to rrdvar flag members

* rrdhost remaining char * members to STRING *

* better error handling on indexing

* strings now use a read/write lock to allow parallel searches to the index

* removed AVL support from dictionaries; implemented STRING with native Judy calls

* string releases should be negative

* only 31 bits are allowed for enum flags

* proper locking on strings

* string threading unittest and fixes

* fix lgtm finding

* fixed naming

* stream chart/dimension definitions at the beginning of a streaming session

* thread stack variable is undefined on thread cancel

* rrdcontext garbage collect per host on startup

* worker control in garbage collection

* relaxed deletion of rrdmetrics

* type checking on dictfe

* netdata chart to monitor rrdcontext triggers

* Group chart label updates

* rrdcontext better handling of collected rrdsets

* rrdpush incremental transmition of definitions should use as much buffer as possible

* require 1MB per chart

* empty the sender buffer before enabling metrics streaming

* fill up to 50% of buffer

* reset signaling metrics sending

* use the shared variable for status

* use separate host flag for enabling streaming of metrics

* make sure the flag is clear

* add logging for streaming

* add logging for streaming on buffer overflow

* circular_buffer proper sizing

* removed obsolete logs

* do not execute worker jobs if not necessary

* better messages about compression disabling

* proper use of flags and updating rrdset last access time every time the obsoletion flag is flipped

* monitor stream sender used buffer ratio

* Update exporting unit tests

* no need to compare label value with strcmp

* streaming send workers now monitor bandwidth

* workers now use strings

* streaming receiver monitors incoming bandwidth

* parser shift of worker ids

* minor fixes

* Group chart label updates

* Populate context with dimensions that have data

* Fix chart id

* better shift of parser worker ids

* fix for streaming compression

* properly count received bytes

* ensure LZ4 compression ring buffer does not wrap prematurely

* do not stream empty charts; do not process empty instances in rrdcontext

* need_to_send_chart_definition() does not need an rrdset lock any more

* rrdcontext objects are collected, after data have been written to the db

* better logging of RRDCONTEXT transitions

* always set all variables needed by the worker utilization charts

* implemented double linked list for most objects; eliminated alarm indexes from rrdhost; and many more fixes

* lockless strings design - string_dup() and string_freez() are totally lockless when they dont need to touch Judy - only Judy is protected with a read/write lock

* STRING code re-organization for clarity

* thread_cache improvements; double numbers precision on worker threads

* STRING_ENTRY now shadown STRING, so no duplicate definition is required; string_length() renamed to string_strlen() to follow the paradigm of all other functions, STRING internal statistics are now only compiled with NETDATA_INTERNAL_CHECKS

* rrdhost index by hostname now cleans up; aclk queries of archieved hosts do not index hosts

* Add index to speed up database context searches

* Removed last_updated optimization (was also buggy after latest merge with master)

Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Co-authored-by: Vladimir Kobal <vlad@prokk.net>
2022-09-05 19:31:06 +03:00
Stelios Fragkakis
544aef1fde
Clean chart hash map ()
Clean chart hash map after 7 days (eventually to be removed)
2022-09-05 10:22:57 +03:00
netdatabot
c30ada7d80 [ci skip] Update changelog and version for nightly build: v1.36.0-82-nightly. 2022-09-05 00:19:23 +00:00
Austin S. Hemmelgarn
5cff446d17
Assorted updates for apps_groups.conf. () 2022-09-04 21:50:35 +03:00
netdatabot
2ee7865b13 [ci skip] Update changelog and version for nightly build: v1.36.0-80-nightly. 2022-09-04 00:17:44 +00:00
Ilya Mashchenko
15602f43d1
fix apps plugin users charts descriptipon () 2022-09-04 01:58:14 +03:00
netdatabot
53abc92b8a [ci skip] Update changelog and version for nightly build: v1.36.0-78-nightly. 2022-09-03 00:16:15 +00:00
Ilya Mashchenko
89d3db69b1
add Postgres total connection utilization alarm () 2022-09-02 22:43:26 +03:00
Ilya Mashchenko
13aaa7923d
update Postgres "connections" dashboard info () 2022-09-02 22:43:11 +03:00