Ema has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326247 )

Change subject: dstat_varnishstat: remove varnish 3 compatibility code
......................................................................


dstat_varnishstat: remove varnish 3 compatibility code

Bug: T150660
Change-Id: I1ef6b555a14352cf0d82daf93877872e62ed7f44
---
M modules/varnish/files/dstat_varnishstat.py
1 file changed, 4 insertions(+), 21 deletions(-)

Approvals:
  Ema: Verified; Looks good to me, approved



diff --git a/modules/varnish/files/dstat_varnishstat.py 
b/modules/varnish/files/dstat_varnishstat.py
index ecc053b..2bfe269 100644
--- a/modules/varnish/files/dstat_varnishstat.py
+++ b/modules/varnish/files/dstat_varnishstat.py
@@ -49,22 +49,11 @@
         if os.system("varnishstat -1 > /dev/null") != 0:
             raise Exception("Non-zero exit code from varnishstat")
 
-    def version(self):
-        cmd = os.popen("""varnishstat -V 2>&1 |
-                          awk 'NR==1 { print $2 }' |
-                          tr -d '('
-                       """)
-        return cmd.readline().rstrip()
-
     def varnishstat(self, frontend=False):
-        if "varnish-4" in self.version():
-            cmd = ("varnishstat -1 -f MAIN.n_object -f MAIN.n_lru_nuked "
-                   "-f MAIN.backend_fail -f MAIN.threads "
-                   "-f MAIN.threads_created "
-                   "-f MAIN.exp_mailed -f MAIN.exp_received")
-        else:
-            cmd = ("varnishstat -1 -f n_object -f n_lru_nuked "
-                   "-f backend_fail -f n_wrk -f n_wrk_create")
+        cmd = ("varnishstat -1 -f MAIN.n_object -f MAIN.n_lru_nuked "
+               "-f MAIN.backend_fail -f MAIN.threads "
+               "-f MAIN.threads_created "
+               "-f MAIN.exp_mailed -f MAIN.exp_received")
 
         if frontend:
             cmd += " -n frontend"
@@ -82,12 +71,6 @@
             item = "%s-%s" % (label, row[0].replace("MAIN.", ""))
             value = float(row[1])
             total[item] = value
-
-        if "varnish-3" in self.version():
-            total["fe-threads_created"] = total.get("fe-n_wrk_create", 0)
-            total["be-threads_created"] = total.get("be-n_wrk_create", 0)
-            total["fe-threads"] = total.get("fe-n_wrk", 0)
-            total["be-threads"] = total.get("be-n_wrk", 0)
 
         # Expiry mailbox lag
         total["fe-exp-lag"] = total.get("fe-exp_mailed", 0) - \

-- 
To view, visit https://gerrit.wikimedia.org/r/326247
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ef6b555a14352cf0d82daf93877872e62ed7f44
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <e...@wikimedia.org>
Gerrit-Reviewer: Ema <e...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to