summaryrefslogtreecommitdiff
path: root/src/mod_rrdtool.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2020-07-31 03:51:56 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-10-03 09:05:38 -0400
commitd4937e29f1cbb7df3d96ecda1e8e74c99883168f (patch)
treece6e81707b9c1c824d094eaf7a472dfbd215f88b /src/mod_rrdtool.c
parentafc2025d8edba323453033dadf10469011ddcf8a (diff)
downloadlighttpd-git-d4937e29f1cbb7df3d96ecda1e8e74c99883168f.tar.gz
[mod_accesslog,mod_rrdtool] HTTP/2 basic accounting
Note: rrdtool counts do not include HTTP/2 protocol overhead. Continue to count mod_rrdtool per request rather than per connection so that data is updated after each request, rather than aggregated to the end of a potentially long-lived connection with many keep-alives.
Diffstat (limited to 'src/mod_rrdtool.c')
-rw-r--r--src/mod_rrdtool.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c
index dfdb0e97..6fd376d0 100644
--- a/src/mod_rrdtool.c
+++ b/src/mod_rrdtool.c
@@ -424,8 +424,14 @@ REQUESTDONE_FUNC(mod_rrd_account) {
rrd_config * const rrd = p->conf.rrd;
if (NULL == rrd) return HANDLER_GO_ON;
++rrd->requests;
+ if (r->http_version <= HTTP_VERSION_1_1) {
rrd->bytes_written += (r->con->bytes_written - r->bytes_written_ckpt);
rrd->bytes_read += (r->con->bytes_read - r->bytes_read_ckpt);
+ }
+ else {
+ rrd->bytes_written += r->write_queue->bytes_out;
+ rrd->bytes_read += r->read_queue->bytes_in;
+ }
return HANDLER_GO_ON;
}