Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Update JSON format to include timestamp and branch info #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions benchmarker/cmd/ann_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ type ResultsJSONBenchmark struct {
HeapAllocBytes float64 `json:"heap_alloc_bytes"`
HeapInuseBytes float64 `json:"heap_inuse_bytes"`
HeapSysBytes float64 `json:"heap_sys_bytes"`
Timestamp string `json:"timestamp"`
Branch string `json:"branch"`
Commit string `json:"commit"`
TestId string `json:"test_id"`
}

// Convert an int to a uuid formatted string
Expand Down Expand Up @@ -962,6 +966,10 @@ func runQueries(cfg *Config, importTime time.Duration, testData [][]float32, nei
HeapAllocBytes: memstats.HeapAllocBytes,
HeapInuseBytes: memstats.HeapInuseBytes,
HeapSysBytes: memstats.HeapSysBytes,
Timestamp: time.Now().Format(time.RFC3339),
Branch: cfg.Branch,
Commit: cfg.Commit,
TestId: cfg.TestId,
}

jsonData, err := json.Marshal(benchResult)
Expand Down Expand Up @@ -1188,6 +1196,12 @@ func initAnnBenchmark() {
"filterStrategy", "sweeping", "Use a different filter strategy (options are sweeping or acorn)")
annBenchmarkCommand.PersistentFlags().IntVar(&globalConfig.ReplicationFactor,
"replicationFactor", 1, "Replication factor")
annBenchmarkCommand.PersistentFlags().StringVar(&globalConfig.Branch,
"branch", "main", "Branch name")
annBenchmarkCommand.PersistentFlags().StringVar(&globalConfig.Commit,
"commit", "1234567890", "Commit hash")
annBenchmarkCommand.PersistentFlags().StringVar(&globalConfig.TestId,
"testId", "sq_1", "Test ID")
}

func benchmarkANN(cfg Config, queries Queries, neighbors Neighbors, filters []int) Results {
Expand Down
3 changes: 3 additions & 0 deletions benchmarker/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ type Config struct {
Filter bool
FlatSearchCutoff int
FilterStrategy string
Branch string
Commit string
TestId string
}

func (c *Config) Validate() error {
Expand Down
2 changes: 1 addition & 1 deletion benchmarker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3
xxhash==3.5.0
yarl==1.18.3
yarl==1.18.3