MDL-15273 basic read/write perf counter in moodle_database

This commit is contained in:
skodak 2008-06-16 21:01:54 +00:00
parent 45d4986761
commit ab130a0b5f
9 changed files with 90 additions and 27 deletions

View file

@ -48,7 +48,16 @@ abstract class moodle_database {
*/
protected $dboptions;
// TODO: perf stuff goes here
/**
* The database reads (performance counter).
*/
protected $reads = 0;
/**
* The database writes (performance counter).
*/
protected $writes = 0;
// TODO: do we really need record caching??
/**
@ -1393,4 +1402,12 @@ abstract class moodle_database {
public function rollback_sql() {
return true;
}
public function perf_get_reads() {
return $this->reads;
}
public function perf_get_writes() {
return $this->writes;
}
}