[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Revert "Add configuration value to run interwiki load test"

2016-12-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/325849 )

Change subject: Revert "Add configuration value to run interwiki load test"
..


Revert "Add configuration value to run interwiki load test"

Load test is complete, remove all the extra complexity we added
to run the test.

This reverts commit a8f6f8c88eb690c2d4a13f4bf0560bd8527547a6.

Change-Id: I19a6506ead56ef4469237c4688e06ec5f8c28fce
---
M CirrusSearch.php
M includes/CirrusSearch.php
M includes/ElasticsearchIntermediary.php
M includes/InterwikiSearcher.php
M includes/RequestLogger.php
D tests/unit/InterwikiSearcherTest.php
6 files changed, 13 insertions(+), 208 deletions(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  DCausse: Looks good to me, approved



diff --git a/CirrusSearch.php b/CirrusSearch.php
index 2782a77..2072727 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -538,18 +538,6 @@
 // Results are cached.
 $wgCirrusSearchInterwikiSources = [];
 
-/**
- * Temporary special configuration for load testing the addition of interwiki
- * search results to a wiki. If this value is null then nothing special
- * happens, and wgCirrusSearchInterwikiSources is treated as usual. If this is
- * set to a value between 0 and 1 that is treated as the % of requests to
- * Special:Search that should use wgCirrusSearchInterwikiSources to make a
- * query. The results of this query will not be attached to the
- * SearchResultSet, and will not be displayed to the user. This is to estimate
- * the effect of adding this additional load onto a search cluster.
- */
-$wgCirrusSearchInterwikiLoadTest = null;
-
 // How long to cache interwiki search results for (in seconds)
 $wgCirrusSearchInterwikiCacheTime = 7200;
 
diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index a31e310..7424603 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -393,12 +393,6 @@
$iwSearch->setReturnQuery( $dumpQuery );
$iwSearch->setDumpResult( $dumpResult );
$iwSearch->setReturnExplain( $returnExplain );
-   // This is not strictly true, or even really half true. 
It is a stand
-   // in for the purposes of interwiki load testing using 
the full
-   // search configuration, rather than the limited 
InterwikiResultsType.
-   // InterwikiSearcher will use this or 
InterwikiResultsType depending
-   // on it's needs.
-   $iwSearch->setResultsType( $resultsType );
$interwikiResults = $iwSearch->getInterwikiResults( 
$term );
if ( $interwikiResults !== null ) {
// If we are dumping we need to convert into an 
array that can be appended to
diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index e29235f..823e447 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -254,28 +254,11 @@
}
 
/**
-* Append a payload entry to the last request that was performed.
-*
 * @param string $key
 * @param string $value
 */
static public function appendLastLogPayload( $key, $value ) {
-   if ( self::$requestLogger !== null ) {
-   self::$requestLogger->appendLastLogPayload( $key, 
$value );
-   }
-   }
-
-   /**
-* Append a top-level payload entry to the request set log.
-*
-* @param string $key
-* @param string $value
-*/
-   static public function appendPayload( $key, $value ) {
-   if ( self::$requestLogger === null ) {
-   self::$requestLogger = new RequestLogger;
-   }
-   self::$requestLogger->appendPayload( $key, $value );
+   self::$requestLogger->appendLastLogPayload( $key, $value );
}
 
/**
diff --git a/includes/InterwikiSearcher.php b/includes/InterwikiSearcher.php
index 4ced44f..2c166df 100644
--- a/includes/InterwikiSearcher.php
+++ b/includes/InterwikiSearcher.php
@@ -33,16 +33,6 @@
const MAX_RESULTS = 5;
 
/**
-* @var bool Is the interwiki load test configured?
-*/
-   private $isLoadTest = false;
-
-   /**
-* @var bool Is the interwiki load test enabled?
-*/
-   private $isLoadTestEnabled = false;
-
-   /**
 * Constructor
 * @param Connection $connection
 * @param SearchConfig $config
@@ -57,27 +47,7 @@
return $namespace <= 15;
} );
}
-
-   $limit = self::MAX_RESULTS;
-
-   

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Revert "Add configuration value to run interwiki load test"

2016-12-07 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/325849 )

Change subject: Revert "Add configuration value to run interwiki load test"
..

Revert "Add configuration value to run interwiki load test"

Load test is complete, remove all the extra complexity we added
to run the test.

This reverts commit a8f6f8c88eb690c2d4a13f4bf0560bd8527547a6.

Change-Id: I19a6506ead56ef4469237c4688e06ec5f8c28fce
---
M CirrusSearch.php
M includes/CirrusSearch.php
M includes/ElasticsearchIntermediary.php
M includes/InterwikiSearcher.php
M includes/RequestLogger.php
D tests/unit/InterwikiSearcherTest.php
6 files changed, 13 insertions(+), 208 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/49/325849/1

diff --git a/CirrusSearch.php b/CirrusSearch.php
index 2782a77..2072727 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -538,18 +538,6 @@
 // Results are cached.
 $wgCirrusSearchInterwikiSources = [];
 
-/**
- * Temporary special configuration for load testing the addition of interwiki
- * search results to a wiki. If this value is null then nothing special
- * happens, and wgCirrusSearchInterwikiSources is treated as usual. If this is
- * set to a value between 0 and 1 that is treated as the % of requests to
- * Special:Search that should use wgCirrusSearchInterwikiSources to make a
- * query. The results of this query will not be attached to the
- * SearchResultSet, and will not be displayed to the user. This is to estimate
- * the effect of adding this additional load onto a search cluster.
- */
-$wgCirrusSearchInterwikiLoadTest = null;
-
 // How long to cache interwiki search results for (in seconds)
 $wgCirrusSearchInterwikiCacheTime = 7200;
 
diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index 2717105..4a0c64f 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -393,12 +393,6 @@
$iwSearch->setReturnQuery( $dumpQuery );
$iwSearch->setDumpResult( $dumpResult );
$iwSearch->setReturnExplain( $returnExplain );
-   // This is not strictly true, or even really half true. 
It is a stand
-   // in for the purposes of interwiki load testing using 
the full
-   // search configuration, rather than the limited 
InterwikiResultsType.
-   // InterwikiSearcher will use this or 
InterwikiResultsType depending
-   // on it's needs.
-   $iwSearch->setResultsType( $resultsType );
$interwikiResults = $iwSearch->getInterwikiResults( 
$term );
if ( $interwikiResults !== null ) {
// If we are dumping we need to convert into an 
array that can be appended to
diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index e29235f..823e447 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -254,28 +254,11 @@
}
 
/**
-* Append a payload entry to the last request that was performed.
-*
 * @param string $key
 * @param string $value
 */
static public function appendLastLogPayload( $key, $value ) {
-   if ( self::$requestLogger !== null ) {
-   self::$requestLogger->appendLastLogPayload( $key, 
$value );
-   }
-   }
-
-   /**
-* Append a top-level payload entry to the request set log.
-*
-* @param string $key
-* @param string $value
-*/
-   static public function appendPayload( $key, $value ) {
-   if ( self::$requestLogger === null ) {
-   self::$requestLogger = new RequestLogger;
-   }
-   self::$requestLogger->appendPayload( $key, $value );
+   self::$requestLogger->appendLastLogPayload( $key, $value );
}
 
/**
diff --git a/includes/InterwikiSearcher.php b/includes/InterwikiSearcher.php
index 4ced44f..2c166df 100644
--- a/includes/InterwikiSearcher.php
+++ b/includes/InterwikiSearcher.php
@@ -33,16 +33,6 @@
const MAX_RESULTS = 5;
 
/**
-* @var bool Is the interwiki load test configured?
-*/
-   private $isLoadTest = false;
-
-   /**
-* @var bool Is the interwiki load test enabled?
-*/
-   private $isLoadTestEnabled = false;
-
-   /**
 * Constructor
 * @param Connection $connection
 * @param SearchConfig $config
@@ -57,27 +47,7 @@
return $namespace <= 15;
} );
}
-
-   $limit = self::MAX_RESULTS;
-
-   $loadTestPercent = $config->get( 
'CirrusSearchInterwikiLoadTest' );
-