1
0
mirror of https://github.com/apache/httpd.git synced 2025-04-18 22:24:07 +03:00

*) scoreboard/mod_http2: record durations of HTTP/2 requests.

PR 69579 [Pierre Brochard <pierre.brochard.1982@m4x.org>]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923754 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Eissing 2025-02-12 09:43:40 +00:00
parent 3af0d142f1
commit e3d014c009
5 changed files with 27 additions and 3 deletions

View File

@ -0,0 +1,2 @@
*) scoreboard/mod_http2: record durations of HTTP/2 requests.
PR 69579 [Pierre Brochard <pierre.brochard.1982@m4x.org>]

View File

@ -734,6 +734,7 @@
* 20211221.26 (2.5.1-dev) Add is_host_matchable to proxy_worker_shared
* 20211221.27 (2.5.1-dev) Add sock_proto to proxy_worker_shared, and AP_LISTEN_MPTCP
* 20211221.28 (2.5.1-dev) Add dav_get_base_path() to mod_dav
* 20211221.29 (2.5.1-dev) Add ap_set_time_process_request() to scoreboard.h
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
@ -741,7 +742,7 @@
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20211221
#endif
#define MODULE_MAGIC_NUMBER_MINOR 28 /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 29 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a

View File

@ -197,7 +197,9 @@ AP_DECLARE(int) ap_update_child_status_from_server(ap_sb_handle_t *sbh, int stat
AP_DECLARE(int) ap_update_child_status_descr(ap_sb_handle_t *sbh, int status, const char *descr);
AP_DECLARE(void) ap_time_process_request(ap_sb_handle_t *sbh, int status);
AP_DECLARE(void) ap_set_time_process_request(ap_sb_handle_t* const sbh,
const apr_time_t timebeg,const apr_time_t timeend);
AP_DECLARE(int) ap_update_global_status(void);
AP_DECLARE(worker_score *) ap_get_scoreboard_worker(ap_sb_handle_t *sbh);

View File

@ -29,6 +29,7 @@
#include <http_connection.h>
#include <http_log.h>
#include <http_protocol.h>
#include <scoreboard.h>
#include <mpm_common.h>
@ -975,7 +976,9 @@ static void s_c2_done(h2_mplx *m, conn_rec *c2, h2_conn_ctx_t *conn_ctx)
/* From here on, the final handling of c2 is done by c1 processing.
* Which means we can give it c1's scoreboard handle for updates. */
c2->sbh = m->c1->sbh;
#if AP_MODULE_MAGIC_AT_LEAST(20211221, 29)
ap_set_time_process_request(c2->sbh,conn_ctx->started_at,conn_ctx->done_at);
#endif
ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, c2,
"h2_mplx(%s-%d): request done, %f ms elapsed",
conn_ctx->id, conn_ctx->stream_id,

View File

@ -654,6 +654,22 @@ AP_DECLARE(void) ap_time_process_request(ap_sb_handle_t *sbh, int status)
}
}
AP_DECLARE(void) ap_set_time_process_request(ap_sb_handle_t* const sbh,
const apr_time_t timebeg,const apr_time_t timeend)
{
if (!sbh || sbh->child_num < 0)
return;
worker_score* const ws =
&ap_scoreboard_image->servers[sbh->child_num][sbh->thread_num];
ws->start_time = timebeg;
ws->stop_time = ws->last_used = timeend;
if (ap_extended_status)
ws->duration += timeend - timebeg;
}
AP_DECLARE(int) ap_update_global_status(void)
{
#ifdef HAVE_TIMES