feat(search): support platform and benchmark config filters
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:
2026-04-15 20:23:37 +03:00
parent f21728e1ef
commit 64e3c1966d
9 changed files with 309 additions and 60 deletions

View File

@@ -60,6 +60,7 @@ type BenchmarkResult struct {
type Submission struct {
SubmissionID string `json:"submissionID"`
Submitter string `json:"submitter"`
Platform string `json:"platform"`
SubmittedAt time.Time `json:"submittedAt"`
BenchmarkResult
}
@@ -111,6 +112,27 @@ func NormalizeSubmitter(submitter string) string {
return submitter
}
func NormalizePlatform(platform string) string {
switch strings.ToLower(strings.TrimSpace(platform)) {
case "", "windows":
return "windows"
case "linux":
return "linux"
case "macos":
return "macos"
default:
return ""
}
}
func ValidatePlatform(platform string) error {
if NormalizePlatform(platform) == "" {
return errors.New("platform must be one of windows, linux, or macos")
}
return nil
}
func ThreadModeLabel(multiCore bool) string {
if multiCore {
return "Multi-threaded"