mongodb.h 852 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_EXPORTING_MONGODB_H
  3. #define NETDATA_EXPORTING_MONGODB_H
  4. #include "exporting/exporting_engine.h"
  5. #include "exporting/json/json.h"
  6. #include <mongoc.h>
  7. struct bson_buffer {
  8. bson_t **insert;
  9. size_t documents_inserted;
  10. size_t buffered_bytes;
  11. struct bson_buffer *next;
  12. };
  13. struct mongodb_specific_data {
  14. mongoc_client_t *client;
  15. mongoc_collection_t *collection;
  16. size_t total_documents_inserted;
  17. struct bson_buffer *first_buffer;
  18. struct bson_buffer *last_buffer;
  19. };
  20. int mongodb_init(struct instance *instance);
  21. void mongodb_cleanup(struct instance *instance);
  22. int init_mongodb_instance(struct instance *instance);
  23. int format_batch_mongodb(struct instance *instance);
  24. void mongodb_connector_worker(void *instance_p);
  25. #endif //NETDATA_EXPORTING_MONGODB_H