mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Several improvements for performance measuring
This commit is contained in:
parent
2c93067682
commit
fdee002f73
9 changed files with 87 additions and 36 deletions
|
@ -23,6 +23,9 @@ class dba {
|
|||
public $error = false;
|
||||
|
||||
function __construct($server,$user,$pass,$db,$install = false) {
|
||||
global $a;
|
||||
|
||||
$stamp1 = microtime(true);
|
||||
|
||||
$server = trim($server);
|
||||
$user = trim($user);
|
||||
|
@ -64,6 +67,8 @@ class dba {
|
|||
if(! $install)
|
||||
system_unavailable();
|
||||
}
|
||||
|
||||
$a->save_timestamp($stamp1, "network");
|
||||
}
|
||||
|
||||
public function getdb() {
|
||||
|
@ -87,7 +92,6 @@ class dba {
|
|||
|
||||
$stamp2 = microtime(true);
|
||||
$duration = (float)($stamp2-$stamp1);
|
||||
$a->performance["database"] += (float)$duration;
|
||||
|
||||
if(x($a->config,'system') && x($a->config['system'],'db_log')) {
|
||||
if (($duration > $a->config["system"]["db_loglimit"])) {
|
||||
|
@ -164,6 +168,7 @@ class dba {
|
|||
}
|
||||
}
|
||||
|
||||
$a->save_timestamp($stamp1, "database");
|
||||
|
||||
if($this->debug)
|
||||
logger('dba: ' . printable(print_r($r, true)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue