festbench-web/database/factories/PsychbenchResultFactory.php

39 lines
1.5 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\BenchmarkRun;
use App\Models\PsychbenchResult;
use Illuminate\Database\Eloquent\Factories\Factory;
/** @extends Factory<PsychbenchResult> */
class PsychbenchResultFactory extends Factory
{
public function definition(): array
{
$ttft = round($this->faker->randomFloat(2, 0.1, 4), 2);
$checksTotal = $this->faker->numberBetween(3, 8);
return [
'benchmark_run_id' => BenchmarkRun::factory(),
'ran_at' => now(),
'task' => $this->faker->randomElement(['billing_form', 'irreducible_contradiction', 'sunk_cost']),
'level' => $this->faker->randomElement(['off', 'low', 'medium', 'xhigh']),
'ok' => $this->faker->boolean(70),
'decode' => round($this->faker->randomFloat(2, 10, 150), 2),
'user_tps' => round($this->faker->randomFloat(2, 5, 100), 2),
'ttft' => $ttft,
't_answer' => $ttft,
'wall' => round($ttft + $this->faker->randomFloat(2, 0.5, 30), 2),
'reasoning' => $this->faker->numberBetween(0, 2000),
'visible' => $this->faker->numberBetween(20, 400),
'total' => $this->faker->numberBetween(20, 2000),
'finish' => 'stop',
'detail' => null,
'section' => null,
'checks_passed' => $this->faker->numberBetween(0, $checksTotal),
'checks_total' => $checksTotal,
'payload' => ['ok' => true],
];
}
}