From 11b645484576f239f3853014463045df93e9e2a5 Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Wed, 11 Dec 2024 11:18:41 +0100 Subject: [PATCH] Add subtitles to benchmark charts. (#522) They include a little more context about what each of the benchmarks are showing. --------- Co-authored-by: Andrew Farries --- dev/benchmark-results/build.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dev/benchmark-results/build.go b/dev/benchmark-results/build.go index 002cda87..0321bbc8 100644 --- a/dev/benchmark-results/build.go +++ b/dev/benchmark-results/build.go @@ -58,6 +58,7 @@ func buildCharts(inputFile, outputFile string) error { page.SetLayout("flex") for _, c := range allCharts { + c.Subtitle = getSubTitle(c.Title.Title) page.AddCharts(c) } @@ -243,6 +244,21 @@ func shortSHA(sha string) string { return sha[:7] } +func getSubTitle(title string) string { + switch { + case strings.HasPrefix(title, "Backfill"): + return "Each line represents the rows per second backfilled for a database with the row count indicated. The x-axis shows the commits to main ordered by time." + case strings.HasPrefix(title, "WriteAmplification/NoTrigger"): + return "Each line represents the rows per second written for a database with the row count indicated. This is a baseline benchmark without the pgroll trigger. The x-axis shows the commits to main ordered by time." + case strings.HasPrefix(title, "WriteAmplification/WithTrigger"): + return "Each line represents the rows per second written for a database with the row count indicated. This is a benchmark with the pgroll trigger installed and should be compared with the WriteAmplification/NoTrigger benchmarks. The x-axis shows the commits to main ordered by time." + case strings.HasPrefix(title, "ReadSchema"): + return "This benchmark shows the executions per second of an important internal SQL function, ReadSchema. The x-axis shows the commits to main ordered by time" + } + + return "" +} + type BenchmarkReports struct { GitSHA string PostgresVersion string