{{ $locustResult->school_name }}
已完成
返回清單
@if($locustResult->report_path && file_exists(public_path($locustResult->report_path)))
完整 HTML 報告
@endif
@can('module-admin', 'K6TestController')
編輯
@endcan
{{-- ── 測試概覽 ── --}}
@php
$s = $locustResult->result_summary ?? [];
$failRate = ($s['total_requests'] ?? 0) > 0
? round(($s['total_failures'] ?? 0) / $s['total_requests'] * 100, 1)
: 0;
$statusColor = $failRate > 10 ? 'danger' : ($failRate > 0 ? 'warning' : 'success');
@endphp
@php
$metricCards = [
['label'=>'請求總數', 'value'=>number_format($s['total_requests']??0), 'unit'=>'次', 'color'=>'primary', 'icon'=>'bi-send'],
['label'=>'失敗數', 'value'=>number_format($s['total_failures']??0), 'unit'=>'次', 'color'=>'danger', 'icon'=>'bi-x-circle'],
['label'=>'失敗率', 'value'=>$failRate, 'unit'=>'%', 'color'=>$statusColor,'icon'=>'bi-percent'],
['label'=>'平均回應時間', 'value'=>round($s['avg_response']??0), 'unit'=>'ms', 'color'=>'info', 'icon'=>'bi-clock'],
['label'=>'P95 回應時間', 'value'=>round($s['p95_response']??0), 'unit'=>'ms', 'color'=>'warning', 'icon'=>'bi-clock-history'],
['label'=>'每秒請求數', 'value'=>round($s['rps']??0, 1), 'unit'=>'RPS', 'color'=>'success', 'icon'=>'bi-lightning-charge'],
];
@endphp
@foreach($metricCards as $mc)
{{ $mc['value'] }} {{ $mc['unit'] }}
{{ $mc['label'] }}
@endforeach