2026-09-17 02:34:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
2026-09-18 18:41:33 +00:00
|
|
|
/**
|
|
|
|
|
* Shared behavior for per-suite result tables. Each concrete model declares
|
|
|
|
|
* its own $fillable (suite-specific columns + core) — submitted metrics are
|
|
|
|
|
* immutable once stored, exactly like the parent BenchmarkRun.
|
|
|
|
|
*/
|
|
|
|
|
abstract class SuiteResult extends Model
|
2026-09-17 02:34:43 +00:00
|
|
|
{
|
|
|
|
|
protected function casts(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2026-09-18 18:41:33 +00:00
|
|
|
'ran_at' => 'datetime',
|
2026-09-17 02:34:43 +00:00
|
|
|
'ok' => 'boolean',
|
|
|
|
|
'decode' => 'float',
|
|
|
|
|
'user_tps' => 'float',
|
|
|
|
|
'ttft' => 'float',
|
|
|
|
|
't_answer' => 'float',
|
|
|
|
|
'wall' => 'float',
|
|
|
|
|
'reasoning' => 'integer',
|
|
|
|
|
'visible' => 'integer',
|
|
|
|
|
'total' => 'integer',
|
|
|
|
|
'payload' => 'array',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function run(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(BenchmarkRun::class, 'benchmark_run_id');
|
|
|
|
|
}
|
|
|
|
|
}
|