@extends('layouts.app') @section('title', 'Chi tiết ngày - API Health') @section('page_title', 'Chi tiết ngày - API Health') @section('breadcrumb') @endsection @push('styles') @endpush @section('content') @php $methodBadgeClass = [ 'GET' => 'badge-success', 'POST' => 'badge-primary', 'PUT' => 'badge-warning', 'PATCH' => 'badge-warning', 'DELETE' => 'badge-danger', ]; $successRateOverall = $totalChecks > 0 ? round(($totalChecks - $totalErrors) / $totalChecks * 100, 1) : null; $doughnutColors = ['#e74c3c', '#e67e22', '#f1c40f', '#9b59b6', '#34495e', '#1abc9c', '#95a5a6']; @endphp Quay lại
{{ $api->method }} {{ $api->url }}
{{ $api->server?->domain?->name ?? '—' }} {{ $api->server?->ip_address ?? '—' }} {{ $date->format('d/m/Y') }}
@if ($totalChecks === 0)
Không có dữ liệu healthcheck cho ngày này.
@else
Tổng check
{{ $totalChecks }}
Tỉ lệ thành công
{{ $successRateOverall }}%
Avg (ms)
{{ round($stats['avg_response_time_ms']) }}
Min / Max (ms)
{{ $stats['min_response_time_ms'] }} / {{ $stats['max_response_time_ms'] }}

Tỉ lệ thành công theo giờ

Response time trung bình (Avg ms) theo giờ

Tỉ lệ thành công ≥ 99% — ổn định 90% – 98.9% — cảnh báo nhẹ < 90% — đáng lo
Avg phản hồi (ms) < 300ms — nhanh 300 – 999ms — chậm ≥ 1000ms — rất chậm
@foreach ($hourlyLabels as $i => $label) @php $hourTotal = $hourlyTotalChecks[$i]; $hourRate = $successRates[$i]; $hourAvg = $avgResponseTimes[$i]; $hourRateStatus = $hourRate === null ? null : ($hourRate >= 99 ? 'success' : ($hourRate >= 90 ? 'warning' : 'danger')); $hourAvgStatus = $hourAvg === null ? null : ($hourAvg < 300 ? 'success' : ($hourAvg < 1000 ? 'warning' : 'danger')); @endphp @endforeach
Giờ Tổng check Tỉ lệ thành công Avg (ms)
{{ $label }} @if ($hourTotal > 0) {{ $hourTotal }} @else — @endif @if ($hourRate !== null) {{ $hourRate }}% @else — @endif @if ($hourAvg !== null) {{ $hourAvg }} ms @else — @endif

Tổng hợp lỗi trong ngày

@if ($totalErrors === 0)
Không có lỗi nào trong ngày này 🎉
@else

Tổng số lần lỗi: {{ $totalErrors }} / {{ $totalChecks }} lần check ({{ round($totalErrors / $totalChecks * 100, 1) }}%)

@foreach ($errorBreakdown as $i => $err) @php $groupId = 'error-group-'.$i; @endphp
{{ $err['label'] }}
{{ $err['count'] }} lần {{ $err['pctOfErrors'] }}% tổng lỗi {{ $err['pctOfTotal'] }}% tổng check
@foreach ($err['items'] as $item)
{{ $item['time'] }} {{ $item['message'] ?? '(không có nội dung lỗi)' }}
@endforeach
@endforeach
@endif
@endif @endsection @push('scripts') @if ($totalChecks > 0) @endif @endpush