Skip to content

Commit

Permalink
[ADP-3389] Collect history of benchmark results in the CI of the rele…
Browse files Browse the repository at this point in the history
…ase candidate (#4688)

- [x] Add buildkite client library that support retrieving builds by
branch and artifacts
- [x] Collect benchmark CSV from buildkite
- [x] Produce a csv file containing the historical data
- [x] Produce a chart for every metrics
- [x] Add a step in the pipeline of the release-candidate build that
produce an artifact with the historical data and the 289 charts

ADP-3389
  • Loading branch information
paolino authored Jul 24, 2024
2 parents b6d16cd + cff494c commit dbc8a44
Show file tree
Hide file tree
Showing 17 changed files with 1,432 additions and 48 deletions.
22 changes: 21 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ steps:
artifact_paths: [ "./bench-results.csv" ]
concurrency: 4
concurrency_group: 'concurrent-benchmarks'
key: api-benchmark

- label: Latency Benchmark (linux)
command: |
Expand All @@ -310,6 +311,7 @@ steps:
artifact_paths: [ "./bench-results.csv" ]
concurrency: 4
concurrency_group: 'concurrent-benchmarks'
key: latency-benchmark

- label: DB Benchmark (linux)
command: |
Expand All @@ -323,6 +325,7 @@ steps:
artifact_paths: [ "./bench-results.csv" ]
concurrency: 4
concurrency_group: 'concurrent-benchmarks'
key: db-benchmark

- label: Read-blocks Benchmark (linux)
command: |
Expand All @@ -336,7 +339,7 @@ steps:
artifact_paths: [ "./bench-results.csv" ]
concurrency: 4
concurrency_group: 'concurrent-benchmarks'

key: read-blocks-benchmark

- label: Memory Benchmark (linux)
command: |
Expand All @@ -351,6 +354,23 @@ steps:
artifact_paths: [ "./bench-results.csv" ]
concurrency: 4
concurrency_group: 'concurrent-benchmarks'
key: memory-benchmark

- label: Benchmarks history
if: build.env("RELEASE_CANDIDATE") != null
depends_on:
- api-benchmark
- latency-benchmark
- db-benchmark
- read-blocks-benchmark
- memory-benchmark
- trigger-benchmarks
artifact_paths:
- ./benchmark-history*.tgz
command: |
./scripts/buildkite/main/benchmark-history.sh
agents:
system: x86_64-linux

- input: "Restoration Benchmark Parameters"
if: build.env("RELEASE_CANDIDATE") == null
Expand Down
4 changes: 4 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ packages:
lib/application-extras
lib/balance-tx/
lib/benchmarks/
lib/buildkite/
lib/cardano-api-extra/
lib/crypto-primitives/
lib/coin-selection/
Expand Down Expand Up @@ -232,6 +233,9 @@ cabal-lib-version: 3.6

test-show-details: direct

package cardano-wallet-buildkite
tests: True

package delta-chain
tests: True

Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
};
# Local test cluster and mock metadata server
inherit (project.hsPkgs.cardano-wallet.components.exes) mock-token-metadata-server;
inherit (project.hsPkgs.cardano-wallet-benchmarks.components.exes) benchmark-history;
inherit (project.hsPkgs.local-cluster.components.exes) local-cluster;
inherit (project.hsPkgs.cardano-wallet-integration.components.exes) integration-exe;
inherit (project.hsPkgs.local-cluster.components.exes) test-local-cluster-exe;
Expand Down
45 changes: 39 additions & 6 deletions lib/benchmarks/cardano-wallet-benchmarks.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ library
, aeson
, base
, bytestring
, cardano-addresses
, cardano-wallet
, cardano-wallet-api
, cardano-wallet-application-extras
, cardano-wallet-integration:framework
, cardano-wallet-launcher
, cardano-wallet-network-layer
, cardano-wallet-primitive
, cardano-wallet-test-utils
, cassava
, comonad
, containers
, diagrams-lib
, diagrams-rasterific
, Chart-diagrams
, Chart
, criterion-measurement
, deepseq
, directory
, extra
, faucet
, filepath
, fmt
, foldl
Expand All @@ -67,7 +67,9 @@ library
, http-types
, iohk-monitoring
, iohk-monitoring-extra
, JuicyPixels
, local-cluster
, monoidal-containers
, mtl
, optparse-applicative
, pathtype
Expand All @@ -86,10 +88,12 @@ library
, with-utf8

exposed-modules:
Cardano.Wallet.BenchShared
Cardano.Wallet.Benchmarks.Collect
Cardano.Wallet.Benchmarks.Latency.Measure
Cardano.Wallet.Benchmarks.History
Cardano.Wallet.Benchmarks.Charting
Cardano.Wallet.Benchmarks.Latency.BenchM
Cardano.Wallet.Benchmarks.Latency.Measure
Cardano.Wallet.BenchShared

benchmark restore
import: language, opts-exe
Expand Down Expand Up @@ -257,3 +261,32 @@ benchmark read-blocks
, time

default-language: Haskell2010

executable benchmark-history
import: language, opts-exe
hs-source-dirs: exe
main-is: benchmark-history.hs
build-depends:
, aeson
, base
, bytestring
, cardano-wallet-benchmarks
, cardano-wallet-buildkite
, cassava
, containers
, directory
, filepath
, exceptions
, foldl
, http-client
, http-client-tls
, http-media
, monoidal-containers
, optparse-applicative
, pretty-simple
, servant
, servant-client
, streaming
, text
, time
, vector
2 changes: 1 addition & 1 deletion lib/benchmarks/exe/api-bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import Cardano.Wallet.Benchmarks.Collect
, Reporter (addSemantic, report)
, Result (Result)
, Semantic
, Units (Seconds)
, Unit (Seconds)
, mkSemantic
, newReporterFromEnv
)
Expand Down
Loading

0 comments on commit dbc8a44

Please sign in to comment.