From de4773462d0239ed53f3272af1bfaf41235fb11d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 29 Apr 2008 11:59:10 +0000 Subject: [PATCH] Add pf_memory field --- includes/Profiler.php | 6 +++--- maintenance/archives/patch-profiling.sql | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/Profiler.php b/includes/Profiler.php index b1f9b7aeaa..86b4f45720 100644 --- a/includes/Profiler.php +++ b/includes/Profiler.php @@ -271,7 +271,7 @@ class Profiler { 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"; @@ -300,7 +300,7 @@ class Profiler { /** * @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; } @@ -323,7 +323,7 @@ class Profiler { $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); diff --git a/maintenance/archives/patch-profiling.sql b/maintenance/archives/patch-profiling.sql index bafd2b67ae..84464e8eec 100644 --- a/maintenance/archives/patch-profiling.sql +++ b/maintenance/archives/patch-profiling.sql @@ -4,6 +4,7 @@ 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) -- 2.20.1