replication.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef REPLICATION_H
  3. #define REPLICATION_H
  4. #include "daemon/common.h"
  5. struct replication_query_statistics {
  6. SPINLOCK spinlock;
  7. size_t queries_started;
  8. size_t queries_finished;
  9. size_t points_read;
  10. size_t points_generated;
  11. };
  12. struct replication_query_statistics replication_get_query_statistics(void);
  13. bool replicate_chart_response(RRDHOST *rh, RRDSET *rs, bool start_streaming, time_t after, time_t before);
  14. typedef int (*send_command)(const char *txt, void *data);
  15. bool replicate_chart_request(send_command callback, void *callback_data,
  16. RRDHOST *rh, RRDSET *rs,
  17. time_t child_first_entry, time_t child_last_entry, time_t child_wall_clock_time,
  18. time_t response_first_start_time, time_t response_last_end_time);
  19. void replication_init_sender(struct sender_state *sender);
  20. void replication_cleanup_sender(struct sender_state *sender);
  21. void replication_sender_delete_pending_requests(struct sender_state *sender);
  22. void replication_add_request(struct sender_state *sender, const char *chart_id, time_t after, time_t before, bool start_streaming);
  23. void replication_recalculate_buffer_used_ratio_unsafe(struct sender_state *s);
  24. size_t replication_allocated_memory(void);
  25. size_t replication_allocated_buffers(void);
  26. #endif /* REPLICATION_H */