*/ private const MODELS = [ 'softbench' => SoftbenchResult::class, 'infrabench' => InfrabenchResult::class, 'prosebench' => ProsebenchResult::class, 'psychbench' => PsychbenchResult::class, 'scenariobench' => ScenarioRun::class, ]; /** Model class handling results for $suite, or null if unregistered. */ public static function modelFor(?string $suite): ?string { return self::MODELS[$suite] ?? null; } /** Name of the HasMany relation on BenchmarkRun for $suite. */ public static function runRelation(string $suite): string { return $suite === 'scenariobench' ? 'scenarioRuns' : $suite.'Results'; } /** Source table in the festbench SQLite db for $suite. */ public static function sourceTable(string $suite): string { return config("festbench.source_tables.{$suite}", 'results'); } /** All registered suites, active and inactive. */ public static function all(): array { return array_keys(self::MODELS); } /** * Active suites (appear in the suite filter and run-detail rendering). * * @return Collection */ public static function active(): Collection { return collect(self::MODELS) ->filter(fn (string $m, string $suite) => config("festbench.suites.{$suite}.active", false)) ->keys(); } /** * Active suites that participate in the combined all_results view. * * @return Collection */ public static function inAllResults(): Collection { return collect(self::MODELS) ->filter(fn (string $m, string $suite) => config("festbench.suites.{$suite}.active", false) && config("festbench.suites.{$suite}.in_all_results", false)) ->keys(); } }