feat(search): support platform and benchmark config filters
Some checks failed
Build and Publish Docker Image / deploy (push) Failing after 1m2s
Some checks failed
Build and Publish Docker Image / deploy (push) Failing after 1m2s
Add platform handling to submissions and persist a normalized value (`windows`, `linux`, `macos`) with a default of `windows` when omitted. Extend search/index filtering to support `thread`, `platform`, `intensity`, and `durationSecs` alongside existing text/CPU token matching, and wire these params through request parsing, page data, and navigation URLs. Update API/README docs and examples to reflect the new submission inputs and search capabilities so users can run more precise queries.feat(search): support platform and benchmark config filters Add platform handling to submissions and persist a normalized value (`windows`, `linux`, `macos`) with a default of `windows` when omitted. Extend search/index filtering to support `thread`, `platform`, `intensity`, and `durationSecs` alongside existing text/CPU token matching, and wire these params through request parsing, page data, and navigation URLs. Update API/README docs and examples to reflect the new submission inputs and search capabilities so users can run more precise queries.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<p class="text-sm uppercase tracking-[0.35em] text-cyan-300">CPU Benchmark Platform</p>
|
||||
<div class="mt-4 flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between">
|
||||
<div class="max-w-3xl">
|
||||
<h1 class="text-4xl font-bold tracking-tight">Submission browser and API for local CPU benchmark runs</h1>
|
||||
<h1 class="text-4xl font-bold tracking-tight">Simple CPU Benchmark Server</h1>
|
||||
<p class="mt-3 text-sm text-slate-300">
|
||||
Browse recent benchmark submissions, filter by submitter or CPU brand, and inspect per-core throughput details.
|
||||
</p>
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
<main class="mx-auto max-w-7xl px-6 py-8">
|
||||
<section class="-mt-12 rounded-3xl border border-slate-200 bg-white p-6 shadow-xl shadow-slate-300/30">
|
||||
<form method="get" action="/" class="grid gap-4 lg:grid-cols-[2fr_2fr_auto]">
|
||||
<form method="get" action="/" class="grid gap-4 lg:grid-cols-[2fr_2fr_1fr_1fr_1fr_1fr_auto]">
|
||||
<label class="block">
|
||||
<span class="mb-2 block text-sm font-medium text-slate-700">General search</span>
|
||||
<input
|
||||
@@ -52,6 +52,51 @@
|
||||
class="w-full rounded-xl border-slate-300 bg-slate-50 text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
||||
>
|
||||
</label>
|
||||
<label class="block">
|
||||
<span class="mb-2 block text-sm font-medium text-slate-700">Thread mode</span>
|
||||
<select
|
||||
name="thread"
|
||||
class="w-full rounded-xl border-slate-300 bg-slate-50 text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
||||
>
|
||||
<option value="" {{ if eq .QueryThread "" }}selected{{ end }}>All</option>
|
||||
<option value="single" {{ if eq .QueryThread "single" }}selected{{ end }}>Single-threaded</option>
|
||||
<option value="multi" {{ if eq .QueryThread "multi" }}selected{{ end }}>Multi-threaded</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="block">
|
||||
<span class="mb-2 block text-sm font-medium text-slate-700">Platform</span>
|
||||
<select
|
||||
name="platform"
|
||||
class="w-full rounded-xl border-slate-300 bg-slate-50 text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
||||
>
|
||||
<option value="" {{ if eq .QueryPlatform "" }}selected{{ end }}>All</option>
|
||||
<option value="windows" {{ if eq .QueryPlatform "windows" }}selected{{ end }}>Windows</option>
|
||||
<option value="linux" {{ if eq .QueryPlatform "linux" }}selected{{ end }}>Linux</option>
|
||||
<option value="macos" {{ if eq .QueryPlatform "macos" }}selected{{ end }}>macOS</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="block">
|
||||
<span class="mb-2 block text-sm font-medium text-slate-700">Intensity</span>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
name="intensity"
|
||||
value="{{ if gt .QueryIntensity 0 }}{{ .QueryIntensity }}{{ end }}"
|
||||
placeholder="10"
|
||||
class="w-full rounded-xl border-slate-300 bg-slate-50 text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
||||
>
|
||||
</label>
|
||||
<label class="block">
|
||||
<span class="mb-2 block text-sm font-medium text-slate-700">Duration (s)</span>
|
||||
<input
|
||||
type="number"
|
||||
min="1"
|
||||
name="durationSecs"
|
||||
value="{{ if gt .QueryDuration 0 }}{{ .QueryDuration }}{{ end }}"
|
||||
placeholder="20"
|
||||
class="w-full rounded-xl border-slate-300 bg-slate-50 text-sm shadow-sm focus:border-cyan-500 focus:ring-cyan-500"
|
||||
>
|
||||
</label>
|
||||
<div class="flex gap-3 lg:justify-end">
|
||||
<button
|
||||
type="submit"
|
||||
@@ -79,7 +124,7 @@
|
||||
{{ range .Submissions }}
|
||||
<details class="group overflow-hidden rounded-3xl border border-slate-200 bg-white shadow-sm transition hover:shadow-md">
|
||||
<summary class="list-none cursor-pointer">
|
||||
<div class="grid gap-4 p-6 lg:grid-cols-[1.5fr_2fr_repeat(3,minmax(0,1fr))] lg:items-center">
|
||||
<div class="grid gap-4 p-6 lg:grid-cols-[1.2fr_2fr_repeat(6,minmax(0,1fr))] lg:items-center">
|
||||
<div>
|
||||
<p class="text-xs uppercase tracking-[0.25em] text-slate-400">Submitter</p>
|
||||
<p class="mt-2 text-lg font-semibold text-slate-900">{{ .Submitter }}</p>
|
||||
@@ -102,11 +147,23 @@
|
||||
<p class="text-xs uppercase tracking-[0.25em] text-slate-400">Mode</p>
|
||||
<p class="mt-2 inline-flex rounded-full bg-slate-100 px-3 py-1 text-sm font-medium text-slate-700">{{ modeLabel .Config.MultiCore }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs uppercase tracking-[0.25em] text-slate-400">Platform</p>
|
||||
<p class="mt-2 inline-flex rounded-full bg-cyan-50 px-3 py-1 text-sm font-medium text-cyan-800">{{ .Platform }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs uppercase tracking-[0.25em] text-slate-400">Intensity</p>
|
||||
<p class="mt-2 text-xl font-semibold text-slate-900">{{ .Config.Intensity }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-xs uppercase tracking-[0.25em] text-slate-400">Run Time</p>
|
||||
<p class="mt-2 text-xl font-semibold text-slate-900">{{ .Config.DurationSecs }}s</p>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
|
||||
<div class="border-t border-slate-100 bg-slate-50 px-6 py-6">
|
||||
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
||||
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-6">
|
||||
<div class="rounded-2xl bg-white p-4 shadow-sm">
|
||||
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Started</p>
|
||||
<p class="mt-2 text-sm font-medium text-slate-800">{{ formatTime .StartedAt }}</p>
|
||||
@@ -120,11 +177,27 @@
|
||||
<p class="mt-2 text-sm font-medium text-slate-800">{{ formatInt64 .TotalOps }}</p>
|
||||
</div>
|
||||
<div class="rounded-2xl bg-white p-4 shadow-sm">
|
||||
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Benchmark config</p>
|
||||
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Duration</p>
|
||||
<p class="mt-2 text-sm font-medium text-slate-800">
|
||||
{{ .Config.DurationSecs }}s • intensity {{ .Config.Intensity }} • coreFilter {{ .Config.CoreFilter }}
|
||||
{{ .Config.DurationSecs }} seconds
|
||||
</p>
|
||||
</div>
|
||||
<div class="rounded-2xl bg-white p-4 shadow-sm">
|
||||
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Intensity</p>
|
||||
<p class="mt-2 text-sm font-medium text-slate-800">
|
||||
{{ .Config.Intensity }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="rounded-2xl bg-white p-4 shadow-sm">
|
||||
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Core Filter</p>
|
||||
<p class="mt-2 text-sm font-medium text-slate-800">
|
||||
{{ .Config.CoreFilter }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="rounded-2xl bg-white p-4 shadow-sm">
|
||||
<p class="text-xs uppercase tracking-[0.2em] text-slate-400">Platform</p>
|
||||
<p class="mt-2 text-sm font-medium text-slate-800">{{ .Platform }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 overflow-x-auto rounded-2xl border border-slate-200 bg-white">
|
||||
|
||||
Reference in New Issue
Block a user