global $wgProfileToDatabase;
if ($wgProfileToDatabase) {
- Profiler :: logToDB($fname, (float) ($elapsed * 1000), $calls);
+ Profiler :: logToDB($fname, (float) ($elapsed * 1000), $calls, (float) ($memory * 1000) );
}
}
$prof .= "\nTotal: $total\n\n";
/**
* @static
*/
- function logToDB($name, $timeSum, $eventCount) {
+ function logToDB($name, $timeSum, $eventCount, $memory) {
# Do not log anything if database is readonly (bug 5375)
if( wfReadOnly() ) { return; }
$pfhost = '';
}
- $sql = "UPDATE $profiling "."SET pf_count=pf_count+{$eventCount}, "."pf_time=pf_time + {$timeSum} ".
+ $sql = "UPDATE $profiling "."SET pf_count=pf_count+{$eventCount}, pf_time=pf_time+{$timeSum}, pf_memory=pf_memory+{$memory} ".
"WHERE pf_name='{$encname}' AND pf_server='{$pfhost}'";
$dbw->query($sql);
CREATE TABLE /*$wgDBprefix*/profiling (
pf_count int NOT NULL default 0,
pf_time float NOT NULL default 0,
+ pf_memory float NOT NULL default 0,
pf_name varchar(255) NOT NULL default '',
pf_server varchar(30) NOT NULL default '',
UNIQUE KEY pf_name_server (pf_name, pf_server)