throughput_logging.h 857 B

123456789101112131415161718192021222324
  1. #ifndef MAINLOOP_THROUGHPUT_LOG_H
  2. #define MAINLOOP_THROUGHPUT_LOG_H
  3. #include "lib/time/compat_time.h"
  4. // the main thread should run the following before any threads have been
  5. // created
  6. void init_throughput_logging(int num_threads);
  7. // the main thread should run the following after all threads have completed
  8. void destroy_throughput_logging(void);
  9. // each thread should run the following
  10. void init_thread_throughput_logging(int thread_id);
  11. void destroy_thread_throughput_logging(void);
  12. // each thread should log the sent and received bytes with the following
  13. void log_sent_bytes(uint32_t bytes, monotime_coarse_t *now);
  14. void log_recv_bytes(uint32_t bytes, monotime_coarse_t *now);
  15. // the file should be written to after all threads have finished but before
  16. // calling 'destroy_throughput_logging()'
  17. void write_throughput_log(char *file_name);
  18. #endif