Skip to content

Commit

Permalink
Benchmarking now returns start/stop instead of duration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
darkain authored Mar 16, 2022
1 parent 592cf7d commit fa4ab59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pudl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit fa4ab59

Please sign in to comment.