wiki.techinc.nl/maintenance/mctest.php
Brion Vibber d88bf87284 Apply most of the code tweaks from the live site:
* use configured cache servers for mctest.php
* bucket details in mcc.php
* fix input validation and remove debugging code in compressOld
* full ID range for moveToExternal
* fix resolveStubs.php for compatibility with older serialized data
* maximum line length for bar graphs in getLagTimes.php
* recognize specieswiki in rebuildInterwiki.inc
* --purge option to do additional parser-cache purging for purgeList.php
* default changed in MiniDonation extension
* profile unicode cleanup in Xml
* log slow parses in Article.php
* profile wfMsgReal
* log mkdir failures
* profile AutoLoader
* rebuild empty DjVu metadata containing ''
* security fix for DjVu metadata retrieval
2007-01-17 00:54:54 +00:00

58 lines
1.1 KiB
PHP

<?php
/* $Id$ */
$optionsWithArgs = array( 'i' );
require_once('commandLine.inc');
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
#$wgDebugLogFile = '/dev/stdout';
if ( isset( $args[0] ) ) {
$wgMemCachedServers = array( $args[0] );
}
if ( isset( $options['i'] ) ) {
$iterations = $options['i'];
} else {
$iterations = 100;
}
foreach ( $wgMemCachedServers as $server ) {
print "$server ";
$mcc = new MemCachedClientforWiki( array('persistant' => true) );
$mcc->set_servers( array( $server ) );
$set = 0;
$incr = 0;
$get = 0;
$time_start=microtime_float();
for ( $i=1; $i<=$iterations; $i++ ) {
if ( !is_null( $mcc->set( "test$i", $i ) ) ) {
$set++;
}
}
for ( $i=1; $i<=$iterations; $i++ ) {
if ( !is_null( $mcc->incr( "test$i", $i ) ) ) {
$incr++;
}
}
for ( $i=1; $i<=$iterations; $i++ ) {
$value = $mcc->get( "test$i" );
if ( $value == $i*2 ) {
$get++;
}
}
$exectime=microtime_float()-$time_start;
print "set: $set incr: $incr get: $get time: $exectime\n";
}
?>