Commit 82f56ed7 authored by Geoff Simmons's avatar Geoff Simmons

Add the errs counter.

parent d778ddf5
......@@ -36,4 +36,10 @@
Total number of input bytes processed by the en-/decrypter
.. varnish_vsc:: errs
:type: counter
:oneliner: Errors
Total number of errors encoutered by the en-/decrypter
.. varnish_vsc_end:: ece
......@@ -72,6 +72,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
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.errs == 0
varnish v1 -expect ECE.vfp.ece_decrypt.in == 126
varnish v1 -expect ECE.vfp.ece_decrypt.out == 30
......@@ -134,6 +135,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 3
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 3
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 0
## Errors
......@@ -179,6 +181,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 4
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 4
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 1
server s1 -wait
server s1 {
......@@ -197,6 +200,7 @@ client c1 {
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 5
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 5
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 2
server s1 -wait
server s1 {
......@@ -225,6 +229,7 @@ logexpect l1 -wait
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.errs == 3
server s1 -wait
server s1 {
......@@ -245,6 +250,7 @@ client c1 {
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 7
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 7
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 4
server s1 -wait
server s1 {
......@@ -273,6 +279,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 8
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 8
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 5
server s1 -wait
server s1 {
......@@ -301,6 +308,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 9
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 9
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 6
server s1 -wait
server s1 {
......@@ -329,6 +337,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 10
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 10
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 7
server s1 -wait
server s1 {
......@@ -359,6 +368,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 11
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 11
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 8
server s1 -wait
server s1 -start
......@@ -396,3 +406,4 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_decrypt.ops == 12
varnish v1 -expect ECE.vfp.ece_decrypt.calls >= 12
varnish v1 -expect ECE.vfp.ece_decrypt.errs == 9
......@@ -79,6 +79,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
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.errs == 0
varnish v1 -expect ECE.vfp.vcl1.default_dup.in == 126
varnish v1 -expect ECE.vfp.vcl1.default_dup.out == 30
......@@ -123,6 +124,7 @@ 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.errs == 0
varnish v1 -expect ECE.vfp.vcl2.chunk4k.in == 126
varnish v1 -expect ECE.vfp.vcl2.chunk4k.out == 30
......@@ -167,6 +169,7 @@ 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.errs == 0
varnish v1 -expect ECE.vfp.vcl3.maxrs0.in == 126
varnish v1 -expect ECE.vfp.vcl3.maxrs0.out == 30
......@@ -188,6 +191,7 @@ varnish v1 -vcl+backend {
# Set a max rs that is smaller than the record size
# specified by the response.
new rs1k = ece.decrypter("rs1k", max_rs=1k);
rs1k.create_stats();
}
sub vcl_backend_response {
......@@ -210,6 +214,10 @@ client c1 {
expect resp.reason == "Backend fetch failed"
} -run
logexpect l1 -wait
varnish v1 -expect ECE.vfp.vcl4.rs1k.errs == 1
varnish v1 -errvcl {vmod ece failure: new d: filter name must be non-empty} {
import ${vmod_ece};
backend b { .host = "${bad_ip}"; }
......
......@@ -62,6 +62,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
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.errs == 0
varnish v1 -expect ECE.vfp.ece_encrypt.in == 15
varnish v1 -expect ECE.vfp.ece_encrypt.out == 53
......@@ -93,3 +94,4 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_encrypt.calls >= 2
varnish v1 -expect ECE.vfp.ece_encrypt.errs == 1
......@@ -73,6 +73,7 @@ logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
# VFP declines due to Content-Encoding
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 1
varnish v1 -expect ECE.vfp.ece_encrypt.calls == 0
varnish v1 -expect ECE.vfp.ece_encrypt.errs == 1
server s1 -wait
server s1 {
......@@ -97,6 +98,7 @@ logexpect l1 -wait
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_encrypt.calls == 0
varnish v1 -expect ECE.vfp.ece_encrypt.errs == 2
server s1 -wait
server s1 {
......@@ -115,6 +117,7 @@ client c1 {
varnish v1 -expect ECE.vfp.ece_encrypt.ops == 2
varnish v1 -expect ECE.vfp.ece_encrypt.calls == 0
varnish v1 -expect ECE.vfp.ece_encrypt.errs == 2
# Errors for custom VFPs
......
......@@ -47,6 +47,7 @@ client c1 {
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.errs == 0
varnish v1 -expect ECE.vfp.vcl1.default_dup.in == 15
varnish v1 -expect ECE.vfp.vcl1.default_dup.out == 53
......@@ -95,6 +96,7 @@ 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.errs == 0
varnish v1 -expect ECE.vfp.vcl2.hdr.in == 15
varnish v1 -expect ECE.vfp.vcl2.hdr.out == 53
......@@ -116,6 +118,7 @@ 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.errs == 1
varnish v1 -expect ECE.vfp.vcl2.hdr.in == 15
varnish v1 -expect ECE.vfp.vcl2.hdr.out == 53
......
......@@ -51,6 +51,8 @@ logexpect l1 -v v1 -d 1 -g vxid -q "FetchError" {
expect * = End
} -run
varnish v1 -expect ECE.vfp.ece_encrypt.errs == 1
server s1 -wait
server s1 {
rxreq
......
......@@ -154,11 +154,13 @@ 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.errs == 0
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.errs == 0
varnish v1 -expect ECE.vfp.ece_decrypt.in > 199975
varnish v1 -expect ECE.vfp.ece_decrypt.out == 199975
......@@ -232,11 +234,13 @@ 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.errs == 0
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.errs == 0
varnish v1 -expect ECE.vfp.vcl2.chunk8k.in > 199975
varnish v1 -expect ECE.vfp.vcl2.chunk8k.out == 199975
......@@ -306,11 +310,13 @@ 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.errs == 0
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.errs == 0
varnish v1 -expect ECE.vfp.vcl3.chunk4711.in > 199975
varnish v1 -expect ECE.vfp.vcl3.chunk4711.out == 199975
......
......@@ -169,6 +169,8 @@ vfp_common_fini(struct vfp_ctx *ctx, struct vfp_entry *ent)
if (cfg->stats != NULL) {
cfg->stats->out += ent->bytes_out;
cfg->stats->calls += ent->calls;
if (ent->closed == VFP_ERROR)
cfg->stats->errs++;
}
if (ent->priv1 == NULL)
......
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