rrd_api_web_log.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. /** @file rrd_api_web_log.h
  3. * @brief Incudes the structure and function definitions for
  4. * the web log charts.
  5. */
  6. #ifndef RRD_API_WEB_LOG_H_
  7. #define RRD_API_WEB_LOG_H_
  8. #include "daemon/common.h"
  9. struct File_info;
  10. typedef struct Chart_data_web_log chart_data_web_log_t;
  11. #include "../file_info.h"
  12. #include "../circular_buffer.h"
  13. #include "rrd_api.h"
  14. struct Chart_data_web_log {
  15. time_t last_update;
  16. /* Number of collected log records */
  17. collected_number num_lines;
  18. /* Vhosts */
  19. struct Chart_str cs_vhosts;
  20. collected_number *num_vhosts;
  21. int vhost_size, vhost_size_max; /**< Actual size and maximum allocated size of dim_vhosts, num_vhosts arrays **/
  22. /* Ports */
  23. struct Chart_str cs_ports;
  24. collected_number *num_ports;
  25. int port_size, port_size_max; /**< Actual size and maximum allocated size of dim_ports, num_ports and ports arrays **/
  26. /* IP Version */
  27. collected_number num_ip_ver_4, num_ip_ver_6, num_ip_ver_invalid;
  28. /* Request client current poll */
  29. collected_number num_req_client_current_ipv4, num_req_client_current_ipv6;
  30. /* Request client all-time */
  31. collected_number num_req_client_all_time_ipv4, num_req_client_all_time_ipv6;
  32. /* Request methods */
  33. collected_number num_req_method[REQ_METHOD_ARR_SIZE];
  34. /* Request protocol */
  35. collected_number num_req_proto_http_1, num_req_proto_http_1_1,
  36. num_req_proto_http_2, num_req_proto_other;
  37. /* Request bandwidth */
  38. collected_number num_bandwidth_req_size, num_bandwidth_resp_size;
  39. /* Request processing time */
  40. collected_number num_req_proc_time_min, num_req_proc_time_max, num_req_proc_time_avg;
  41. /* Response code family */
  42. collected_number num_resp_code_family_1xx, num_resp_code_family_2xx,
  43. num_resp_code_family_3xx, num_resp_code_family_4xx,
  44. num_resp_code_family_5xx, num_resp_code_family_other;
  45. /* Response code */
  46. collected_number num_resp_code[RESP_CODE_ARR_SIZE];
  47. /* Response code type */
  48. collected_number num_resp_code_type_success, num_resp_code_type_redirect,
  49. num_resp_code_type_bad, num_resp_code_type_error, num_resp_code_type_other;
  50. /* SSL protocol */
  51. collected_number num_ssl_proto_tlsv1, num_ssl_proto_tlsv1_1,
  52. num_ssl_proto_tlsv1_2, num_ssl_proto_tlsv1_3,
  53. num_ssl_proto_sslv2, num_ssl_proto_sslv3, num_ssl_proto_other;
  54. /* SSL cipher suite */
  55. struct Chart_str cs_ssl_ciphers;
  56. collected_number *num_ssl_ciphers;
  57. int ssl_cipher_size;
  58. };
  59. void web_log_chart_init(struct File_info *p_file_info);
  60. void web_log_chart_update(struct File_info *p_file_info);
  61. #endif // RRD_API_WEB_LOG_H_