3 # Run this script periodically if you have miser mode enabled, to refresh the caches
5 require_once( 'commandLine.inc' );
7 require_once( 'SpecialPage.php' );
8 require_once( 'QueryPage.php' );
12 foreach ( $wgQueryPages as $page ) {
13 list( $class, $special ) = $page;
15 $specialObj = SpecialPage
::getPage( $special );
17 print "No such special page: $special\n";
20 $file = $specialObj->getFile();
22 require_once( $file );
24 $queryPage = new $class;
26 printf( '%-30s', $special );
28 if ( $queryPage->isExpensive() ) {
29 $t1 = explode( ' ', microtime() );
30 $num = $queryPage->doQuery( 0, 0, true );
31 $t2 = explode( ' ', microtime() );
33 print "got $num rows in ";
35 $elapsed = ($t2[0] - $t1[0]) +
($t2[1] - $t1[1]);
36 $hours = intval( $elapsed / 3600 );
37 $minutes = intval( $elapsed %
3600 / 60 );
38 $seconds = $elapsed - $hours * 3600 - $minutes * 60;
43 print $minutes . 'm ';
45 printf( "%.2f s\n", $seconds );
47 print "cheap, skipped\n";