mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-14 11:31:59 +01:00
MINOR: promex: test applet resume in stress mode
Implement a stress mode with force yield for promex applet each time a
metric is displayed. This is implemented by returning 0 in
promex_dump_ts() each time the output buffer is not empty.
To test this, haproxy must be compiled with DEBUG_STRESS and the
following configuration must be used :
global
stress-level 1
This commit is contained in:
parent
9db62d408a
commit
00a106059e
@ -36,6 +36,7 @@
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stconn.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stress.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/version.h>
|
||||
@ -347,6 +348,10 @@ static int promex_dump_ts(struct appctx *appctx, struct ist prefix,
|
||||
istcat(&n, prefix, PROMEX_MAX_NAME_LEN);
|
||||
istcat(&n, name, PROMEX_MAX_NAME_LEN);
|
||||
|
||||
/* In stress mode, force yielding on each metric. */
|
||||
if (STRESS_RUN1(istlen(*out), 0))
|
||||
goto full;
|
||||
|
||||
if ((ctx->flags & PROMEX_FL_METRIC_HDR) &&
|
||||
!promex_dump_ts_header(n, desc, type, out, max))
|
||||
goto full;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user