| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef REPLICATION_H |
| 4 | #define REPLICATION_H |
| 5 | |
| 6 | #include "database/rrd.h" |
| 7 | #include "stream-circular-buffer.h" |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | |
| 13 | #define MAX_REPLICATION_THREADS 256 |
| 14 | #define MAX_REPLICATION_PREFETCH 256 |
| 15 | |
| 16 | struct parser; |
| 17 | |
| 18 | struct replication_query_statistics { |
| 19 | SPINLOCK spinlock; |
| 20 | size_t queries_started; |
| 21 | size_t queries_finished; |
| 22 | size_t points_read; |
| 23 | size_t points_generated; |
| 24 | }; |
| 25 | |
| 26 | struct replication_query_statistics replication_get_query_statistics(void); |
| 27 | |
| 28 | void replication_sender_init(struct sender_state *sender); |
| 29 | void replication_sender_cleanup(struct sender_state *sender); |
| 30 | void replication_sender_delete_pending_requests(struct sender_state *sender); |
| 31 | void replication_sender_request_add(struct sender_state *sender, const char *chart_id, time_t after, time_t before, bool start_streaming); |
| 32 | void replication_sender_recalculate_buffer_used_ratio_unsafe(struct sender_state *s); |
| 33 | |
| 34 | int64_t replication_sender_allocated_memory(void); |
| 35 | size_t replication_sender_allocated_buffers(void); |
| 36 | |
| 37 | int replication_prefetch_default(void); |
| 38 | int replication_threads_default(void); |
| 39 | |
| 40 | #ifdef __cplusplus |
| 41 | } |
| 42 | #endif |
| 43 | |
| 44 | #endif /* REPLICATION_H */ |