mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-19711 dml: Enable use of readonly slave database handles
Implemented with moodle_read_slave_trait Functionality is triggered by supplying config dboption['readonly']. See config-dist.php for more info on supported dboptions. pgsql and mysqli drivers are using this feature. Also added support for connection timeout for these two drivers.
This commit is contained in:
parent
d85118369d
commit
46cfde3d95
19 changed files with 2422 additions and 28 deletions
|
@ -9523,6 +9523,12 @@ function get_performance_info() {
|
|||
$info['html'] .= '<li class="dbqueries col-sm-4">DB reads/writes: '.$info['dbqueries'].'</li> ';
|
||||
$info['txt'] .= 'db reads/writes: '.$info['dbqueries'].' ';
|
||||
|
||||
if ($DB->want_read_slave()) {
|
||||
$info['dbreads_slave'] = $DB->perf_get_reads_slave();
|
||||
$info['html'] .= '<li class="dbqueries col-sm-4">DB reads from slave: '.$info['dbreads_slave'].'</li> ';
|
||||
$info['txt'] .= 'db reads from slave: '.$info['dbreads_slave'].' ';
|
||||
}
|
||||
|
||||
$info['dbtime'] = round($DB->perf_get_queries_time(), 5);
|
||||
$info['html'] .= '<li class="dbtime col-sm-4">DB queries time: '.$info['dbtime'].' secs</li> ';
|
||||
$info['txt'] .= 'db queries time: ' . $info['dbtime'] . 's ';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue