BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/311632
Change subject: add VCL variable "uptime" ...................................................................... add VCL variable "uptime" This is useful for avoiding N-hit-wonder VCL code for a short period after cache restart. Change-Id: I222253d367647b949cb7ff05c6d00029341ca2fd --- A debian/patches/0005-vcl-uptime.patch M debian/patches/series 2 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/varnish4 refs/changes/32/311632/1 diff --git a/debian/patches/0005-vcl-uptime.patch b/debian/patches/0005-vcl-uptime.patch new file mode 100644 index 0000000..c32b932 --- /dev/null +++ b/debian/patches/0005-vcl-uptime.patch @@ -0,0 +1,39 @@ +diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c +index a73489b..f406fdf 100644 +--- a/bin/varnishd/cache/cache_vrt.c ++++ b/bin/varnishd/cache/cache_vrt.c +@@ -297,6 +297,16 @@ VRT_r_now(VRT_CTX) + + /*--------------------------------------------------------------------*/ + ++double ++VRT_r_uptime(VRT_CTX) ++{ ++ ++ (void)ctx; ++ return (double)VSC_C_main->uptime; ++} ++ ++/*--------------------------------------------------------------------*/ ++ + char * + VRT_IP_string(VRT_CTX, VCL_IP ip) + { +diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py +index 7f2b50b..b0c806a 100755 +--- a/lib/libvcc/generate.py ++++ b/lib/libvcc/generate.py +@@ -724,6 +724,13 @@ sp_variables = [ + used in string context it returns a formatted string. + """ + ), ++ ('uptime', ++ 'DURATION', ++ ( 'all',), ++ ( ), """ ++ The time the cache child process has been up in seconds. ++ """ ++ ), + ] + + # Backwards compatibility: diff --git a/debian/patches/series b/debian/patches/series index f218f25..cf5e6c6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 0001-varnishd-persistent-addrarg.patch 0002-varnishd-persistent-fallocate.patch 0004-varnishd-persistent-mmap-exit.patch +0005-vcl-uptime.patch -- To view, visit https://gerrit.wikimedia.org/r/311632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I222253d367647b949cb7ff05c6d00029341ca2fd Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/varnish4 Gerrit-Branch: debian-wmf Gerrit-Owner: BBlack <bbl...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits