From fa4ab5992a2b0925f6229ebdcd05438ec3395e48 Mon Sep 17 00:00:00 2001 From: Vincent Milum Jr Date: Wed, 16 Mar 2022 13:53:17 -0700 Subject: [PATCH] Benchmarking now returns start/stop instead of duration The benchmarking system previously was used for just getting the elapsed time of a particular query. Instead, we are now returning the beginning and end time for a query, and allowing the application to calculate that information as it sees fit. This enables additional metrics, such as measuring PUDL library overhead or "time to first query start". These should be left up to the application to decide what is valuable to track, not left up to this library. --- pudl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pudl.php b/pudl.php index a74172b..110524b 100644 --- a/pudl.php +++ b/pudl.php @@ -234,8 +234,7 @@ public function __invoke($query) { //PERFORMANCE PROFILING DATA if (!empty($this->bench)) { $bench = $this->bench; - $diff = round(microtime(true)-$microtime, 6); - $bench($query, $diff, $this); + $bench($query, $microtime, microtime(true), $this); }