[master] ca32d1467 cache_vcl: Align vcl.list reference counters right

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Aug 28 13:10:06 UTC 2023


commit ca32d146710824c1e05941f5819771a7d50fc45d
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Aug 22 12:07:57 2023 +0200

    cache_vcl: Align vcl.list reference counters right
    
    And drop the artificial 6 digits pseudo-alignment, leading to a more
    compact output when VCLs get less than 100k concurrent client tasks.

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 0ab200739..29d4b459f 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -768,7 +768,7 @@ vcl_cli_list(struct cli *cli, const char * const *av, void *priv)
 			flg = "discarded";
 		} else
 			flg = "available";
-		VTE_printf(vte, "%s\t%s\t%s\t%6u\t%s", flg, vcl->state,
+		VTE_printf(vte, "%s\t%s\t%s\t\v%u\t%s", flg, vcl->state,
 		    vcl->temp->name, vcl->busy, vcl->loaded_name);
 		if (vcl->label != NULL) {
 			VTE_printf(vte, "\t->\t%s", vcl->label->loaded_name);
diff --git a/bin/varnishtest/tests/r02471.vtc b/bin/varnishtest/tests/r02471.vtc
index a573d4a3c..994480af5 100644
--- a/bin/varnishtest/tests/r02471.vtc
+++ b/bin/varnishtest/tests/r02471.vtc
@@ -23,7 +23,7 @@ varnish v1 -vcl+backend {}
 varnish v1 -cliok "vcl.state vcl1 cold"
 
 # Nothing holds vcl1, so it should go gold.
-varnish v1 -cliexpect "cold    cold         0    vcl1" "vcl.list"
+varnish v1 -cliexpect "cold    cold      0   vcl1" "vcl.list"
 
 
 # Grab hold of vcl1
@@ -43,7 +43,7 @@ client c1 {
 
 # There should still be a single busy hold on vcl1
 varnish v1 -cliok "vcl.state vcl1 cold"
-varnish v1 -cliexpect "cold    busy         [12]    vcl1" "vcl.list"
+varnish v1 -cliexpect "cold    busy      [12]   vcl1" "vcl.list"
 
 # Release hold on vcl1
 varnish v1 -cliok "vcl.state vcl1 auto"
@@ -62,4 +62,4 @@ client c1 {
 
 # Nothing holds vcl1, so it should go gold.
 varnish v1 -cliok "vcl.state vcl1 cold"
-varnish v1 -cliexpect "cold    [a-z]+         [01]    vcl1" "vcl.list"
+varnish v1 -cliexpect "cold    ....      [01]   vcl1" "vcl.list"
diff --git a/bin/varnishtest/tests/u00000.vtc b/bin/varnishtest/tests/u00000.vtc
index c33bfc9e4..11cbdb4a0 100644
--- a/bin/varnishtest/tests/u00000.vtc
+++ b/bin/varnishtest/tests/u00000.vtc
@@ -152,8 +152,8 @@ shell {
 }
 
 varnish v2 -arg "-f ${tmpdir}/ok1" -arg "-f ${tmpdir}/ok2" -start
-varnish v2 -cliexpect {available   auto    warm         0    boot0} "vcl.list"
-varnish v2 -cliexpect {active      auto    warm         0    boot} "vcl.list"
+varnish v2 -cliexpect {available   auto    warm      0   boot0} "vcl.list"
+varnish v2 -cliexpect {active      auto    warm      0   boot1} "vcl.list"
 varnish v2 -stop -wait
 
 # Test multiple -f options with a bad VCL
diff --git a/bin/varnishtest/tests/v00045.vtc b/bin/varnishtest/tests/v00045.vtc
index 60504ce73..812c0392a 100644
--- a/bin/varnishtest/tests/v00045.vtc
+++ b/bin/varnishtest/tests/v00045.vtc
@@ -17,7 +17,7 @@ varnish v1 -cliok "vcl.state vcl1 cold"
 # We should now see it as cooling
 delay 1
 
-varnish v1 -cliexpect "available   cold    cooling         0    vcl1" vcl.list
+varnish v1 -cliexpect "available   cold    cooling      0   vcl1" vcl.list
 varnish v1 -clijson "vcl.list -j"
 
 # It can't be warmed up yet
@@ -26,7 +26,7 @@ varnish v1 -cliexpect "vmod-debug ref on vcl1" "vcl.state vcl1 warm"
 
 # It will eventually cool down
 delay 2
-varnish v1 -cliexpect "available   cold    cold         0    vcl1" vcl.list
+varnish v1 -cliexpect "available   cold    cold      0   vcl1" vcl.list
 varnish v1 -clijson "vcl.list -j"
 
 # At this point it becomes possible to warm up again


More information about the varnish-commit mailing list