Skip to content

Commit a716a8e

Browse files
committed
feat: integrate leaf crash into core
1 parent 046978c commit a716a8e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/Db/Core.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ public function execute()
479479
}
480480
}
481481

482+
$queryStartedAt = microtime(true);
483+
482484
if (count($state['bindings']) === 0) {
483485
$this->queryResult = $this->connection($this->currentConnection)->query($state['query']);
484486
} else {
@@ -488,6 +490,12 @@ public function execute()
488490
$this->queryResult = $stmt;
489491
}
490492

493+
if (function_exists('crash')) {
494+
crash()->leaveCrumb($state['query'], 'query', [
495+
'ms' => round((microtime(true) - $queryStartedAt) * 1000, 2),
496+
], false);
497+
}
498+
491499
Builder::$bindings = [];
492500

493501
return $this->queryResult;

0 commit comments

Comments
 (0)