mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-07 10:18:01 +00:00
MEDIUM: stats: report the last check and last agent's output on the CSV status
Now that we can quote unsafe string, it becomes possible to dump the health check responses on the CSV page as well. The two new fields are "last_chk" and "last_agt".
This commit is contained in:
parent
a3310dc66c
commit
a28df3e19a
@ -13009,6 +13009,8 @@ use hard-coded column positions.
|
||||
53. comp_byp: number of bytes that bypassed the HTTP compressor (CPU/BW limit)
|
||||
54. comp_rsp: number of HTTP responses that were compressed
|
||||
55. lastsess: number of seconds since last session assigned to server/backend
|
||||
56. last_chk: last health check contents or textual error
|
||||
57. last_agt: last agent check contents or textual error
|
||||
|
||||
|
||||
9.2. Unix Socket commands
|
||||
|
@ -489,7 +489,7 @@ static void stats_dump_csv_header()
|
||||
"hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,"
|
||||
"req_rate,req_rate_max,req_tot,"
|
||||
"cli_abrt,srv_abrt,"
|
||||
"comp_in,comp_out,comp_byp,comp_rsp,lastsess,"
|
||||
"comp_in,comp_out,comp_byp,comp_rsp,lastsess,last_chk,last_agt,"
|
||||
"\n");
|
||||
}
|
||||
|
||||
@ -2743,8 +2743,8 @@ static int stats_dump_fe_stats(struct stream_interface *si, struct proxy *px)
|
||||
chunk_appendf(&trash, "%lld,",
|
||||
px->fe_counters.p.http.comp_rsp);
|
||||
|
||||
/* lastsess */
|
||||
chunk_appendf(&trash, ",");
|
||||
/* lastsess, last_chk, last_agt, */
|
||||
chunk_appendf(&trash, ",,,");
|
||||
|
||||
/* finish with EOL */
|
||||
chunk_appendf(&trash, "\n");
|
||||
@ -2867,8 +2867,8 @@ static int stats_dump_li_stats(struct stream_interface *si, struct proxy *px, st
|
||||
",,"
|
||||
/* compression: in, out, bypassed, comp_rsp */
|
||||
",,,,"
|
||||
/* lastsess */
|
||||
","
|
||||
/* lastsess, last_chk, last_agt, */
|
||||
",,,"
|
||||
"\n",
|
||||
px->id, l->name,
|
||||
l->nbconn, l->counters->conn_max,
|
||||
@ -3293,6 +3293,10 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
|
||||
/* lastsess */
|
||||
chunk_appendf(&trash, "%d,", srv_lastsession(sv));
|
||||
|
||||
/* capture of last check and agent statuses */
|
||||
chunk_appendf(&trash, "%s,", ((sv->check.state & (CHK_ST_ENABLED|CHK_ST_PAUSED)) == CHK_ST_ENABLED) ? cstr(sv->check.desc) : "");
|
||||
chunk_appendf(&trash, "%s,", ((sv->agent.state & (CHK_ST_ENABLED|CHK_ST_PAUSED)) == CHK_ST_ENABLED) ? cstr(sv->agent.desc) : "");
|
||||
|
||||
/* finish with EOL */
|
||||
chunk_appendf(&trash, "\n");
|
||||
}
|
||||
@ -3523,8 +3527,8 @@ static int stats_dump_be_stats(struct stream_interface *si, struct proxy *px, in
|
||||
/* compression: comp_rsp */
|
||||
chunk_appendf(&trash, "%lld,", px->be_counters.p.http.comp_rsp);
|
||||
|
||||
/* lastsess */
|
||||
chunk_appendf(&trash, "%d,", be_lastsession(px));
|
||||
/* lastsess, last_chk, last_agt, */
|
||||
chunk_appendf(&trash, "%d,,,", be_lastsession(px));
|
||||
|
||||
/* finish with EOL */
|
||||
chunk_appendf(&trash, "\n");
|
||||
|
Loading…
Reference in New Issue
Block a user