festbench-web/app/Models/SuiteResult.php

37 lines
974 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* 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
{
protected function casts(): array
{
return [
'ran_at' => 'datetime',
'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');
}
}