You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

  1. /*
  2. * weighttp - a lightweight and simple webserver benchmarking tool
  3. *
  4. * Author:
  5. * Copyright (c) 2009 Thomas Porzelt
  6. *
  7. * License:
  8. * MIT, see COPYING file
  9. */
  10. struct Stats {
  11. ev_tstamp ts_start; /* start of requests */
  12. ev_tstamp ts_end; /* end of requests */
  13. ev_tstamp req_ts_min; /* minimum time taken for a request */
  14. ev_tstamp req_ts_max; /* maximum time taken for a request */
  15. ev_tstamp req_ts_total; /* total time taken for all requests (this is not ts_end - ts_start!) */
  16. uint64_t req_todo; /* total number of requests to do */
  17. uint64_t req_started; /* total number of requests started */
  18. uint64_t req_done; /* total number of requests done */
  19. uint64_t req_success; /* total number of successful requests */
  20. uint64_t req_failed; /* total number of failed requests */
  21. uint64_t req_error; /* total number of error'd requests */
  22. uint64_t bytes_total; /* total number of bytes received (html+body) */
  23. uint64_t bytes_body; /* total number of bytes received (body) */
  24. };
  25. struct Worker {
  26. uint8_t id;
  27. Config *config;
  28. struct ev_loop *loop;
  29. char *request;
  30. Client **clients;
  31. uint16_t num_clients;
  32. Stats stats;
  33. };
  34. Worker *worker_new(uint8_t id, Config *config, uint16_t num_clients, uint64_t num_requests);
  35. void worker_free(Worker *worker);
  36. void *worker_thread(void* arg);