diff options
author | Andrew Moss <1043609+amoss@users.noreply.github.com> | 2020-06-03 08:38:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 08:38:25 +0200 |
commit | 49719a961d6c079004b65458ea8c5e08ada1c44c (patch) | |
tree | 258b25ac60c403696a72b1589d5fa8634dfc6764 /libnetdata/clocks | |
parent | 1aa2cd7c43f6dd68b4bb43a87eb8b2995687ca9c (diff) |
Fix bugs in streaming and enable support for gap filling (#9214)
This PR adds (inactive) support that we will use to fill the gaps on chart when a receiving agent goes offline and the sender reconnects. The streaming component has been reworked to make the connection bi-directional and fix several outstanding bugs in the area.
* Fixed an incorrect case of version negotiation. Removed fatal() on exhaustion of fds.
* Fixed cases that fell through to polling the socket after closing.
* Fixed locking of data related to sender and receiver in the host structure.
* Added fine-grained locks to reduce contention.
* Added circular buffer to sender to prevent starvation in high-latency conditions.
* Fixed case where agent is a proxy and negotiated different streaming versions with sender and receiver.
* Changed interface to new parser to put the buffering code in streaming.
* Fixed the bug that stopped senders from reconnecting after their socket times out - this was part of the scaling fixes that provide an early shortcut path for rejecting connections without lock contention.
* Uses fine-grained locking and a different approach to thread shutdown instead.
* Added liveness detection to connections to allow selection of the best connection.
Diffstat (limited to 'libnetdata/clocks')
-rw-r--r-- | libnetdata/clocks/clocks.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libnetdata/clocks/clocks.h b/libnetdata/clocks/clocks.h index 83e7c48a2d..cfe99f5e7b 100644 --- a/libnetdata/clocks/clocks.h +++ b/libnetdata/clocks/clocks.h @@ -60,13 +60,23 @@ typedef struct heartbeat { #endif // CLOCK_BOOTTIME +#ifndef NSEC_PER_MSEC #define NSEC_PER_MSEC 1000000ULL +#endif +#ifndef NSEC_PER_SEC #define NSEC_PER_SEC 1000000000ULL +#endif +#ifndef NSEC_PER_USEC #define NSEC_PER_USEC 1000ULL +#endif +#ifndef USEC_PER_SEC #define USEC_PER_SEC 1000000ULL +#endif +#ifndef MSEC_PER_SEC #define MSEC_PER_SEC 1000ULL +#endif #define USEC_PER_MS 1000ULL |