]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: tasks: collect per-task CPU time and latency
authorWilly Tarreau <w@1wt.eu>
Thu, 31 May 2018 12:48:54 +0000 (14:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Nov 2018 14:44:21 +0000 (15:44 +0100)
commit9efd7456e038457257b0901ebd77c4a54da2f83d
treebfce0081d73b83d91445f502a54723170e6d6f1a
parent75c62c2793a8d3aa5afff1793330a13e2d90ea14
MEDIUM: tasks: collect per-task CPU time and latency

Right now we measure for each task the cumulated time spent waiting for
the CPU and using it. The timestamp uses a 64-bit integer to report a
nanosecond-level date. This is only enabled when "profiling.tasks" is
enabled, and consumes less than 1% extra CPU on x86_64 when enabled.
The cumulated processing time and wait time are reported in "show sess".

The task's counters are also reset when an HTTP transaction is reset
since the HTTP part pretends to restart on a fresh new stream. This
will make sure we always report correct numbers for each request in
the logs.
include/proto/task.h
include/types/task.h
src/proto_http.c
src/stream.c
src/task.c