]> git.mxchange.org Git - friendica.git/blobdiff - include/dba.php
Merge pull request #764 from fabrixxm/bug729
[friendica.git] / include / dba.php
index dd7f56bfd9025f77c07d234148c3b8edff53be91..50354b7f49ebaad028dc2042f335ce35ce78d76a 100644 (file)
@@ -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)));