diff --git a/src/Http/Controllers/DashboardController.php b/src/Http/Controllers/DashboardController.php index 024615e..d839567 100644 --- a/src/Http/Controllers/DashboardController.php +++ b/src/Http/Controllers/DashboardController.php @@ -107,8 +107,8 @@ protected function getDashboardStats(): array ->selectRaw(" SUM(COALESCE(db_query_count, 0)) as db_queries, SUM(COALESCE(cache_hit_count, 0) + COALESCE(cache_miss_count, 0)) as cache_calls, - SUM(CASE WHEN http_calls IS NOT NULL AND http_calls != '[]' AND http_calls != 'null' THEN 1 ELSE 0 END) as http_calls, - SUM(CASE WHEN mail_calls IS NOT NULL AND mail_calls != '[]' AND mail_calls != 'null' THEN 1 ELSE 0 END) as mail_calls + SUM(CASE WHEN http_calls IS NOT NULL AND http_calls::text != '[]' AND http_calls::text != 'null' THEN 1 ELSE 0 END) as http_calls, + SUM(CASE WHEN mail_calls IS NOT NULL AND mail_calls::text != '[]' AND mail_calls::text != 'null' THEN 1 ELSE 0 END) as mail_calls ") ->first(); @@ -173,13 +173,13 @@ public function generatePrompt(string $id, AiPromptService $promptService): Json public function stats(): JsonResponse { - $stats = Trace::selectRaw(' + $stats = Trace::selectRaw(" count(*) as total, - count(case when status = "error" then 1 end) as failed, - count(case when status = "success" then 1 end) as success, + count(case when status = 'error' then 1 end) as failed, + count(case when status = 'success' then 1 end) as success, avg(duration_ms) as avg_duration, max(duration_ms) as slowest - ')->first(); + ")->first(); $today = Trace::whereDate('started_at', now()->today())->count();