aclk_collector_list.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. // This is copied from Legacy ACLK, Original Author: amoss
  3. // TODO unmess this
  4. #ifndef ACLK_COLLECTOR_LIST_H
  5. #define ACLK_COLLECTOR_LIST_H
  6. #include "libnetdata/libnetdata.h"
  7. extern netdata_mutex_t collector_mutex;
  8. #define COLLECTOR_LOCK netdata_mutex_lock(&collector_mutex)
  9. #define COLLECTOR_UNLOCK netdata_mutex_unlock(&collector_mutex)
  10. /*
  11. * Maintain a list of collectors and chart count
  12. * If all the charts of a collector are deleted
  13. * then a new metadata dataset must be send to the cloud
  14. *
  15. */
  16. struct _collector {
  17. time_t created;
  18. uint32_t count; //chart count
  19. uint32_t hostname_hash;
  20. uint32_t plugin_hash;
  21. uint32_t module_hash;
  22. char *hostname;
  23. char *plugin_name;
  24. char *module_name;
  25. struct _collector *next;
  26. };
  27. extern struct _collector *collector_list;
  28. struct _collector *_add_collector(const char *hostname, const char *plugin_name, const char *module_name);
  29. struct _collector *_del_collector(const char *hostname, const char *plugin_name, const char *module_name);
  30. void _reset_collector_list();
  31. void _free_collector(struct _collector *collector);
  32. #endif /* ACLK_COLLECTOR_LIST_H */