| 95 | } |
| 96 | |
| 97 | static int systemd_monitor(apr_pool_t *p, server_rec *s) |
| 98 | { |
| 99 | ap_sload_t sload; |
| 100 | apr_interval_time_t up_time; |
| 101 | char bps[5]; |
| 102 | |
| 103 | if (!ap_extended_status) { |
| 104 | /* Nothing useful to report with ExtendedStatus disabled. */ |
| 105 | return DECLINED; |
| 106 | } |
| 107 | |
| 108 | ap_get_sload(&sload); |
| 109 | /* up_time in seconds */ |
| 110 | up_time = (apr_uint32_t) apr_time_sec(apr_time_now() - |
| 111 | ap_scoreboard_image->global->restart_time); |
| 112 | |
| 113 | apr_strfsize((unsigned long)((float) (sload.bytes_served) |
| 114 | / (float) up_time), bps); |
| 115 | |
| 116 | sd_notifyf(0, "READY=1\n" |
| 117 | "STATUS=Total requests: %lu; Idle/Busy workers %d/%d;" |
| 118 | "Requests/sec: %.3g; Bytes served/sec: %sB/sec\n", |
| 119 | sload.access_count, sload.idle, sload.busy, |
| 120 | ((float) sload.access_count) / (float) up_time, bps); |
| 121 | |
| 122 | return DECLINED; |
| 123 | } |
| 124 | |
| 125 | static int ap_find_systemd_socket(process_rec * process, apr_port_t port) { |
| 126 | int fdcount, fd; |
nothing calls this directly
no test coverage detected