Commit d778ddf5 authored by Geoff Simmons's avatar Geoff Simmons

Add the calls counter.

parent 19c7cb4a
......@@ -10,7 +10,19 @@
:type: counter
:oneliner: Operations
Total number of en-/decryption operations
Total number of en-/decryption operations. Not incremented
when the processor declines the operation, for example due
to the Content-Encoding header.
.. varnish_vsc:: calls
:type: counter
:oneliner: Processor calls
Total number of times the processor was called. May be greater
than ops due to multiple fetches per operation. Not incremented
when the processor is never used for a fetch, for example due
to an empty response body (in which case calls may be less than
ops).
.. varnish_vsc:: out
:type: counter
......
......@@ -71,6 +71,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
} -run
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 2
varnish v1 -expect ECE.vfp.ece_decrypt.in == 126
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
......@@ -132,6 +133,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 3
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 3
## Errors
......@@ -176,6 +178,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 4
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 4
server s1 -wait
server s1 {
......@@ -193,6 +196,7 @@ client c1 {
} -run
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 5
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 5
server s1 -wait
server s1 {
......@@ -220,6 +224,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 6
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 6
server s1 -wait
server s1 {
......@@ -239,6 +244,7 @@ client c1 {
} -run
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 7
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 7
server s1 -wait
server s1 {
......@@ -266,6 +272,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 8
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 8
server s1 -wait
server s1 {
......@@ -293,6 +300,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 9
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 9
server s1 -wait
server s1 {
......@@ -320,6 +328,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 10
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 10
server s1 -wait
server s1 {
......@@ -349,6 +358,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 11
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 11
server s1 -wait
server s1 -start
......@@ -385,3 +395,4 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 12
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 12
......@@ -78,6 +78,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
} -run
varnish v1 -expect ECE.vfp.vcl1.default_dup.ops == 2
varnish v1 -expect ECE.vfp.vcl1.default_dup.calls >= 2
varnish v1 -expect ECE.vfp.vcl1.default_dup.in == 126
varnish v1 -expect ECE.vfp.vcl1.default_dup.out == 30
......@@ -121,6 +122,7 @@ client c1 -run
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl2.chunk4k.ops == 2
varnish v1 -expect ECE.vfp.vcl2.chunk4k.calls >= 2
varnish v1 -expect ECE.vfp.vcl2.chunk4k.in == 126
varnish v1 -expect ECE.vfp.vcl2.chunk4k.out == 30
......@@ -164,6 +166,7 @@ client c1 -run
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl3.maxrs0.ops == 2
varnish v1 -expect ECE.vfp.vcl3.maxrs0.calls >= 2
varnish v1 -expect ECE.vfp.vcl3.maxrs0.in == 126
varnish v1 -expect ECE.vfp.vcl3.maxrs0.out == 30
......
......@@ -61,6 +61,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
} -run
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 1
varnish v1 -expect ECE.vfp.ece_encrypt.calls >= 1
varnish v1 -expect ECE.vfp.ece_encrypt.in == 15
varnish v1 -expect ECE.vfp.ece_encrypt.out == 53
......@@ -91,3 +92,4 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_encrypt.calls >= 2
......@@ -72,6 +72,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
# ops not incremented when bypassed due to the empty body, or when the
# VFP declines due to Content-Encoding
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 1
varnish v1 -expect ECE.vfp.ece_encrypt.calls == 0
server s1 -wait
server s1 {
......@@ -95,6 +96,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_encrypt.calls == 0
server s1 -wait
server s1 {
......@@ -112,6 +114,7 @@ client c1 {
} -run
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_encrypt.calls == 0
# Errors for custom VFPs
......
......@@ -46,6 +46,7 @@ client c1 {
} -run
varnish v1 -expect ECE.vfp.vcl1.default_dup.ops == 1
varnish v1 -expect ECE.vfp.vcl1.default_dup.calls >= 1
varnish v1 -expect ECE.vfp.vcl1.default_dup.in == 15
varnish v1 -expect ECE.vfp.vcl1.default_dup.out == 53
......@@ -93,6 +94,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl2.hdr.ops == 1
varnish v1 -expect ECE.vfp.vcl2.hdr.calls >= 1
varnish v1 -expect ECE.vfp.vcl2.hdr.in == 15
varnish v1 -expect ECE.vfp.vcl2.hdr.out == 53
......@@ -113,6 +115,7 @@ client c1 {
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl2.hdr.ops == 2
varnish v1 -expect ECE.vfp.vcl2.hdr.calls >= 2
varnish v1 -expect ECE.vfp.vcl2.hdr.in == 15
varnish v1 -expect ECE.vfp.vcl2.hdr.out == 53
......
......@@ -153,10 +153,12 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
# encrypt.out == decrypt.in, confirm in the log
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 6
varnish v1 -expect ECE.vfp.ece_encrypt.calls >= 6
varnish v1 -expect ECE.vfp.ece_encrypt.in == 199975
varnish v1 -expect ECE.vfp.ece_encrypt.out > 199975
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 6
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 6
varnish v1 -expect ECE.vfp.ece_decrypt.in > 199975
varnish v1 -expect ECE.vfp.ece_decrypt.out == 199975
......@@ -229,10 +231,12 @@ logexpect l1 -wait
# Verify in the logs for the custom VFPs that encrypter.out == decrypter.in
varnish v1 -expect ECE.vfp.vcl2.rs128.ops == 6
varnish v1 -expect ECE.vfp.vcl2.rs128.calls >= 6
varnish v1 -expect ECE.vfp.vcl2.rs128.in == 199975
varnish v1 -expect ECE.vfp.vcl2.rs128.out > 199975
varnish v1 -expect ECE.vfp.vcl2.chunk8k.ops == 6
varnish v1 -expect ECE.vfp.vcl2.chunk8k.calls >= 6
varnish v1 -expect ECE.vfp.vcl2.chunk8k.in > 199975
varnish v1 -expect ECE.vfp.vcl2.chunk8k.out == 199975
......@@ -301,10 +305,12 @@ client c1 -run
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl3.rs815.ops == 6
varnish v1 -expect ECE.vfp.vcl3.rs815.calls >= 6
varnish v1 -expect ECE.vfp.vcl3.rs815.in == 199975
varnish v1 -expect ECE.vfp.vcl3.rs815.out > 199975
varnish v1 -expect ECE.vfp.vcl3.chunk4711.ops == 6
varnish v1 -expect ECE.vfp.vcl3.chunk4711.calls >= 6
varnish v1 -expect ECE.vfp.vcl3.chunk4711.in > 199975
varnish v1 -expect ECE.vfp.vcl3.chunk4711.out == 199975
......
......@@ -166,8 +166,10 @@ vfp_common_fini(struct vfp_ctx *ctx, struct vfp_entry *ent)
AN(ent->vfp);
CAST_OBJ_NOTNULL(cfg, ent->vfp->priv1, VFP_CFG_MAGIC);
if (cfg->stats != NULL)
if (cfg->stats != NULL) {
cfg->stats->out += ent->bytes_out;
cfg->stats->calls += ent->calls;
}
if (ent->priv1 == NULL)
return;
......
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