From b285acf70a6a3570932bfa08228b80205baa9b1f Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 6 Jul 2019 23:01:22 +0100 Subject: [PATCH] tracer-complete needs start time --- composer.lock | 8 ++++---- core/database.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index faa3dd04..172862ac 100644 --- a/composer.lock +++ b/composer.lock @@ -302,12 +302,12 @@ "source": { "type": "git", "url": "https://github.com/shish/eventtracer-php.git", - "reference": "8fc0001dffa6cc68ee56e8681a2e27579eb70dca" + "reference": "af72034e0003d507e1d64f357612312279f02bb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shish/eventtracer-php/zipball/8fc0001dffa6cc68ee56e8681a2e27579eb70dca", - "reference": "8fc0001dffa6cc68ee56e8681a2e27579eb70dca", + "url": "https://api.github.com/repos/shish/eventtracer-php/zipball/af72034e0003d507e1d64f357612312279f02bb4", + "reference": "af72034e0003d507e1d64f357612312279f02bb4", "shasum": "" }, "require": { @@ -338,7 +338,7 @@ ], "description": "An API to write JSON traces as used by the Chrome Trace Viewer", "homepage": "https://github.com/shish/eventtracer-php", - "time": "2019-07-05T14:44:25+00:00" + "time": "2019-07-06T21:56:55+00:00" } ], "packages-dev": [ diff --git a/core/database.php b/core/database.php index 3ed8d36c..23af8bcb 100644 --- a/core/database.php +++ b/core/database.php @@ -192,7 +192,7 @@ class Database { global $_tracer; $dur = microtime(true) - $start; - $_tracer->complete($dur, "DB Query", null, ["query"=>$query, "args"=>$args]); + $_tracer->complete($start * 1000000, $dur * 1000000, "DB Query", null, ["query"=>$query, "args"=>$args]); if ((DEBUG_SQL === true) || (is_null(DEBUG_SQL) && @$_GET['DEBUG_SQL'])) { $query = trim(preg_replace('/\s+/msi', ' ', $query)); @@ -206,7 +206,7 @@ class Database } $this->query_count++; - $this->dbtime += microtime(true) - $start; + $this->dbtime += $dur; } public function execute(string $query, array $args=[]): PDOStatement