mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-15273 basic read/write perf counter in moodle_database
This commit is contained in:
parent
45d4986761
commit
ab130a0b5f
9 changed files with 90 additions and 27 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue