Commit 8a5c0740 authored by Geoff Simmons's avatar Geoff Simmons

Add the out statistic -- total output bytes for the de-/compressor.

parent e3c28439
......@@ -12,4 +12,10 @@
Total number of de-/compression operations
.. varnish_vsc:: out
:type: counter
:oneliner: Output bytes
Total number of bytes output by the de-/compressor
.. varnish_vsc_end:: brotli
......@@ -36,7 +36,9 @@ client c1 -run
varnish v1 -vsc BROTLI.*
varnish v1 -expect BROTLI.br.ops == 10
varnish v1 -expect BROTLI.br.out > 0
varnish v1 -expect BROTLI.unbr.ops == 10
varnish v1 -expect BROTLI.unbr.out > 0
varnish v1 -vcl+backend {
import ${vmod_brotli};
......@@ -59,7 +61,9 @@ varnish v1 -cliok "vcl.list"
varnish v1 -vsc BROTLI.*
varnish v1 -expect BROTLI.br.ops == 10
varnish v1 -expect BROTLI.br.out > 0
varnish v1 -expect BROTLI.unbr.ops == 10
varnish v1 -expect BROTLI.unbr.out > 0
server s1 -wait
server s1 -start
......@@ -67,9 +71,13 @@ client c1 -run
varnish v1 -vsc BROTLI.*
varnish v1 -expect BROTLI.br.ops == 10
varnish v1 -expect BROTLI.br.out > 0
varnish v1 -expect BROTLI.unbr.ops == 10
varnish v1 -expect BROTLI.unbr.out > 0
varnish v1 -expect BROTLI.vcl2.mybr.ops == 10
varnish v1 -expect BROTLI.vcl2.mybr.out > 0
varnish v1 -expect BROTLI.vcl2.myunbr.ops == 10
varnish v1 -expect BROTLI.vcl2.myunbr.out > 0
varnish v1 -vcl+backend {}
......@@ -79,20 +87,28 @@ varnish v1 -cliok "vcl.state vcl2 cold"
# This has to be checked manually in the log.
varnish v1 -vsc BROTLI.vcl2.*
varnish v1 -expect BROTLI.br.ops == 10
varnish v1 -expect BROTLI.br.out > 0
varnish v1 -expect BROTLI.unbr.ops == 10
varnish v1 -expect BROTLI.unbr.out > 0
varnish v1 -cliok "vcl.state vcl2 warm"
# With vcl2 back in the warm state, stats for vcl2.* appear again.
varnish v1 -expect BROTLI.br.ops == 10
varnish v1 -expect BROTLI.br.out > 0
varnish v1 -expect BROTLI.unbr.ops == 10
varnish v1 -expect BROTLI.unbr.out > 0
varnish v1 -expect BROTLI.vcl2.mybr.ops == 10
varnish v1 -expect BROTLI.vcl2.mybr.out > 0
varnish v1 -expect BROTLI.vcl2.myunbr.ops == 10
varnish v1 -expect BROTLI.vcl2.myunbr.out > 0
varnish v1 -cliok "vcl.state vcl2 cold"
varnish v1 -cliok "vcl.discard vcl2"
varnish v1 -cliok "vcl.list"
varnish v1 -vsc BROTLI.*
varnish v1 -vsc BROTLI.vcl2.*
varnish v1 -expect BROTLI.br.ops == 10
varnish v1 -expect BROTLI.br.out > 0
varnish v1 -expect BROTLI.unbr.ops == 10
varnish v1 -expect BROTLI.unbr.out > 0
......@@ -353,12 +353,17 @@ static void v_matchproto_(vfp_fini_f)
vfp_br_fini(struct vfp_ctx *ctx, struct vfp_entry *ent)
{
struct vbr *vbr;
const struct vfp_priv *priv;
CHECK_OBJ_NOTNULL(ctx, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ent, VFP_ENTRY_MAGIC);
AN(ent->vfp);
CAST_OBJ_NOTNULL(priv, ent->vfp->priv1, VFP_PRIV_MAGIC);
if (ent->priv1 != NULL) {
CAST_OBJ(vbr, ent->priv1, VBR_MAGIC);
if (priv->stats != NULL)
priv->stats->out += vbr->stream.total_out;
ent->priv1 = NULL;
destroy(&vbr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment