-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persist benchmark results in CI (#461)
Benchmark results are now collected to a json file which will be appended to a file in s3. Another action will generate static HTML from these results and push them to GitHub Pages.
- Loading branch information
Showing
4 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package benchmarks | ||
|
||
import ( | ||
"os" | ||
"time" | ||
) | ||
|
||
type Reports struct { | ||
GitSHA string | ||
PostgresVersion string | ||
Timestamp int64 | ||
Reports []Report | ||
} | ||
|
||
func (r *Reports) AddReport(report Report) { | ||
r.Reports = append(r.Reports, report) | ||
} | ||
|
||
func getPostgresVersion() string { | ||
return os.Getenv("POSTGRES_VERSION") | ||
} | ||
|
||
func newReports() *Reports { | ||
return &Reports{ | ||
GitSHA: os.Getenv("GITHUB_SHA"), | ||
PostgresVersion: getPostgresVersion(), | ||
Timestamp: time.Now().Unix(), | ||
Reports: []Report{}, | ||
} | ||
} | ||
|
||
type Report struct { | ||
Name string | ||
RowCount int | ||
Unit string | ||
Result float64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters