From edef70c9d03994d40558c66de5a95cedf9ef285c Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 18 Jun 2008 08:26:40 +0000 Subject: [PATCH] MDL-15273 basic read/write perf counter in moodle_database --- lib/dml/moodle_database.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; + } } -- 2.39.5