From: skodak Date: Wed, 18 Jun 2008 08:26:40 +0000 (+0000) Subject: MDL-15273 basic read/write perf counter in moodle_database X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=edef70c9d03994d40558c66de5a95cedf9ef285c;p=moodle.git MDL-15273 basic read/write perf counter in moodle_database --- diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index bb9ab0aaf8..27f24a74a4 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -1403,11 +1403,27 @@ abstract class moodle_database { return true; } + /** + * Returns number of reads done by this database + * @return int + */ public function perf_get_reads() { return $this->reads; } + /** + * Returns number of writes done by this database + * @return int + */ public function perf_get_writes() { return $this->writes; } + + /** + * Returns number of queries done by this database + * @return int + */ + public function perf_get_queries() { + return $this->writes + $this->reads; + } }