40 if (
isset( $this->params[
'perHost'] ) ) {
41 $this->perHost = $this->params[
'perHost'];
46 # Do not log anything if database is readonly (T7375)
58 $dbw->onTransactionCommitOrIdle(
function () use ( $stats,
$fname, $dbw ) {
62 $useTrx = ( $dbw->getType() ===
'sqlite' );
65 $useTrx ? $dbw->startAtomic(
$fname ) :
null;
67 foreach ( $stats as
$data ) {
68 $name =
$data[
'name'];
69 $eventCount =
$data[
'calls'];
72 $name =
substr( $name, 0, 255 );
75 $timeSum = $timeSum >= 0 ?
$timeSum : 0;
78 $dbw->upsert(
'profiling',
81 'pf_count' => $eventCount,
82 'pf_time' => $timeSum,
83 'pf_memory' => $memorySum,
84 'pf_server' => $pfhost
86 [ [
'pf_name',
'pf_server' ] ],
88 "pf_count=pf_count+{$eventCount}",
89 "pf_time=pf_time+{$timeSum}",
90 "pf_memory=pf_memory+{$memorySum}",
100 $useTrx ? $dbw->endAtomic(
$fname ) :
null;
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfReadOnly()
Check whether the wiki is in read-only mode.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfHostname()
Fetch server name for use in error reporting etc.
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
Logs profiling data into the local DB.
log(array $stats)
Log MediaWiki-style profiling data.
canUse()
Can this output type be used?
bool $perHost
Whether to store host data with profiling calls.
__construct(Profiler $collector, array $params)
Base class for profiling output.
array $params
Configuration of $wgProfiler.
Profiler base class that defines the interface and some trivial functionality.
returning false will NOT prevent logging $e
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))