Jgreen has submitted this change and it was merged.

Change subject: apache-fast-test strip transaction metadata before comparing 
response size
......................................................................


apache-fast-test strip transaction metadata before comparing response size

Change-Id: Ib0de970ab193d1a53092c68e0beeb04cdf9aa357
---
M modules/apachesync/files/apache-fast-test
1 file changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Jgreen: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/apachesync/files/apache-fast-test 
b/modules/apachesync/files/apache-fast-test
index 31f012e..66255ca 100755
--- a/modules/apachesync/files/apache-fast-test
+++ b/modules/apachesync/files/apache-fast-test
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# Copyright (c) 2014 Jeff Green <[email protected]>
+# Copyright (c) 2014,2015 Jeff Green <[email protected]>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy 
of
 # this software and associated documentation files (the "Software"), to deal in
@@ -163,7 +163,7 @@
                                );
                                my $r = $ua->simple_request($request);
                                if ($r->is_success) {
-                                       $result{"$ip\t$url"} = $r->status_line 
. ' ' . length($r->content);
+                                       $result{"$ip\t$url"} = $r->status_line 
. ' ' . get_mw_response_size($r->content);
                                } elsif (($r->is_error) and ($r->status_line =~ 
/^500 can't connect/i)) { # simple timeout, drop the data
                                        $timeouts{$ip}++;
                                        print "$name dropped $ip, too many 
timeouts\n" if $timeouts{$ip} >= $timeout_limit;
@@ -177,6 +177,12 @@
        }
 }
 
+sub get_mw_response_size {
+       my $body = shift;
+       $body =~ s/mw.config.set\([^()]+\);//mg; # remove transaction metadata
+       return length($body);
+}
+
 sub get_server_list_from_pybal_config {
        my $servers;
        for my $source (@_) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0de970ab193d1a53092c68e0beeb04cdf9aa357
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jgreen <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Jgreen <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to