diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 75c442b4..d85c0f9e 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -87,47 +87,54 @@ jobs: # Use the PR head SHA on pull_request events (not $GITHUB_SHA, which is the # ephemeral merge commit GitHub creates server-side and that Hydra doesn't see). # Falls back to $GITHUB_SHA on push events. - - name: Wait for kupo-tests in Hydra cache + - name: Wait for kupo binaries in Hydra cache env: TARGET_SHA: ${{ github.event.pull_request.head.sha || github.sha }} run: | set -o pipefail echo "Target SHA: $TARGET_SHA" - if ! out=$(nix eval --raw "git+https://github.com/$GITHUB_REPOSITORY?rev=$TARGET_SHA&submodules=1#kupo-tests"); then - echo "nix eval failed" - exit 1 - fi - if [ -z "$out" ]; then - echo "nix eval returned an empty path" - exit 1 - fi - drv=$(nix eval --raw "git+https://github.com/$GITHUB_REPOSITORY?rev=$TARGET_SHA&submodules=1#kupo-tests.drvPath" 2>/dev/null || true) - echo "Resolved store path: $out" - echo "Derivation path: $drv" - echo "Waiting for $out in cache..." + flake_ref="git+https://github.com/$GITHUB_REPOSITORY?rev=$TARGET_SHA&submodules=1" deadline=$((SECONDS + 1800)) - while true; do - if nix path-info --refresh --store https://cache.iog.io "$out" >/dev/null 2>&1; then - echo "Found in cache" - break + for attr in kupo-tests kupo-tests-accept kupo; do + if ! out=$(nix eval --raw "$flake_ref#$attr"); then + echo "nix eval failed for $attr" + exit 1 fi - if [ "$SECONDS" -ge "$deadline" ]; then - echo "Timed out after 30 minutes waiting for Hydra cache (path: $out)" + if [ -z "$out" ]; then + echo "nix eval returned an empty path for $attr" exit 1 fi - echo "Not in cache yet, waiting 30s..." - sleep 30 + drv=$(nix eval --raw "$flake_ref#$attr.drvPath" 2>/dev/null || true) + echo "[$attr] resolved store path: $out" + echo "[$attr] derivation path: $drv" + echo "[$attr] waiting for $out in cache..." + while true; do + if nix path-info --refresh --store https://cache.iog.io "$out" >/dev/null 2>&1; then + echo "[$attr] found in cache" + break + fi + if [ "$SECONDS" -ge "$deadline" ]; then + echo "Timed out after 30 minutes waiting for Hydra cache ($attr path: $out)" + exit 1 + fi + echo "[$attr] not in cache yet, waiting 30s..." + sleep 30 + done done - - name: Download test binary from Hydra cache + - name: Download binaries from Hydra cache env: TARGET_SHA: ${{ github.event.pull_request.head.sha || github.sha }} run: | - nix build "git+https://github.com/$GITHUB_REPOSITORY?rev=$TARGET_SHA&submodules=1#kupo-tests" \ - --builders "" --max-jobs 0 + flake_ref="git+https://github.com/$GITHUB_REPOSITORY?rev=$TARGET_SHA&submodules=1" mkdir -p bin - cp result/bin/unit bin/unit - chmod +x bin/unit + for pair in "kupo-tests:unit" "kupo-tests-accept:accept" "kupo:kupo"; do + attr="${pair%%:*}" + exe="${pair##*:}" + nix build "$flake_ref#$attr" --builders "" --max-jobs 0 -o "result-$exe" + cp "result-$exe/bin/$exe" "bin/$exe" + chmod +x "bin/$exe" + done - name: Download cardano-node configs env: @@ -164,14 +171,41 @@ jobs: run: ./.github/workflows/scripts/preprod-node-sync.sh 0.9999 - name: Run integration tests + env: + CARDANO_NODE_SOCKET: ${{ runner.temp }}/ipc/node.socket + CARDANO_NODE_CONFIG: ${{ github.workspace }}/config/preprod/config.json + run: sudo -E ./bin/unit + + # The accept suite asks `cardano-cli` for the node tip. The attribute is + # cached on cache.iog.io; --max-jobs 0 stops CI from ever building it. + - name: Provide cardano-cli + run: | + nix build "github:IntersectMBO/cardano-node/$CARDANO_NODE_VERSION#cardano-cli" \ + --builders "" --max-jobs 0 -o result-cardano-cli + cp result-cardano-cli/bin/cardano-cli bin/cardano-cli + + # Runs before the sudo step, which leaves root-owned test-accept/point-*.dat. + # Root ignores file permissions, so only a normal user enforces them. + - name: Run read-only acceptance test without root + env: + CARDANO_NODE_SOCKET: ${{ runner.temp }}/ipc/node.socket + CARDANO_NODE_CONFIG: ${{ github.workspace }}/config/preprod/config.json + run: | + sudo chmod a+w "$CARDANO_NODE_SOCKET" + PATH="$PWD/bin:$PATH" ./bin/accept --match "Can start in readonly mode on readonly DB" + + # Run from the checkout: the suite reads and writes test-accept/point-*.dat. + # sudo resets PATH, so pass it explicitly. + - name: Run acceptance tests env: CARDANO_NODE_SOCKET: ${{ runner.temp }}/ipc/node.socket CARDANO_NODE_CONFIG: ${{ github.workspace }}/config/preprod/config.json # Skipped tests are known to be flaky. run: | - sudo -E ./bin/unit \ - --skip "Dynamically add pattern and restart to a past point when at the tip" \ - --skip "Auto-magically restart when reaching the tip" + sudo -E env "PATH=$PWD/bin:$PATH" ./bin/accept \ + --skip "Auto-magically restarts when --defer-db-indexes is enabled" \ + --skip "Dynamically adds pattern and rolls back (when at tip)" \ + --skip "Can start in readonly mode on readonly DB" - name: Stop cardano-node if: always() && steps.node.outputs.node-started == 'true' diff --git a/CHANGELOG.md b/CHANGELOG.md index b5eaf2a6..a3ffb77a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### [2.12.0] - UNRELEASED +### [Unreleased] #### Added @@ -29,14 +29,42 @@ - Kupo is now built against the ledger and consensus libraries of cardano-node 11.2 (cardano-ledger-core 1.23 and ouroboros-consensus 5.4). -- Fixed network synchronisation calculations (see [#191](https://github.com/CardanoSolutions/kupo/issues/191)). - - Fixed the input index and the redeemer reported in `spent_at` (`input_index` and `redeemer`) for transactions that spend two or more inputs. Since 2.10.0, Kupo numbered the inputs from the last one, so the index and the redeemer did not match the ledger. They now follow the ledger's input order. For the spends recorded before the upgrade, Kupo registers a data repair, and warns at every start until it is applied. If the index matches `*`, was synchronised from origin and was never pruned with `--prune-utxo`, run `kupo db migrate --confirm-complete-index` to apply it; otherwise, resynchronise. - At startup, Kupo adds three empty columns to the `inputs` table of an existing database, to prepare the indexing of Dijkstra sub-transactions. The change is automatic and instant, and needs no action. - Kupo now returns datums and redeemers from Babbage and Conway transaction witnesses with their on-chain bytes, as it already does for inline datums and other eras. Earlier versions returned a re-encoding of the same value, which cannot be used as-is to spend an output locked by that datum's hash. Databases built by earlier versions keep the re-encoded bytes. +- Kupo now limits the statistics scan of SQLite's `PRAGMA optimize`, which it runs at start-up, after `kupo copy` and on every garbage collection pass. On large databases the unbounded scan could take hours and stall chain sync. See https://github.com/CardanoSolutions/kupo/issues/209. + +#### Removed + +N/A + +### [2.12.0] - 2026-07-18 + +#### Added + +- Allow controlling return type of asset quantities through a media query. Allowing string instead of integer when using `Accept: application/json:asset-quantity=string`. + +- New slot-range index usage for wildcard (*) match queries (see [#194](https://github.com/CardanoSolutions/kupo/issues/194)). + +- Custom indexes can now be added via environment variable, prefixed with `KUPO_INDEX_`. They behave as standard indexes with regards to `--defer-db-indexes` and are only installed if not already present. Indexes are named after the environment variable (after the dropping the prefix). So for example, to add an index for unspent inputs by payment credential, you can now provide: + + ```console + KUPO_INDEX_inputsByPaymentCredentialUnspent="inputs(payment_credential COLLATE NOCASE) WHERE spent_at IS NULL" kupo ... + ``` + +#### Changed + +- Bumped internal dependencies to cardano-node==11.0.1. + +- Fixed network synchronisation calculations (see [#191](https://github.com/CardanoSolutions/kupo/issues/191)). + +- Rework some integration tests to avoid issues with closed file handles. + +- Fixed read-only mode requiring write permissions on the database directory. + #### Removed N/A diff --git a/Makefile b/Makefile index 70be3930..6f18f15b 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ archive: kupo-$(TAG)-$(ARCH)-$(OS).tar.gz # Package the application as a tarball kupo.sqlite3-$(NETWORK).tar.gz: @echo "Taking snapshot of NETWORK=$(NETWORK)." sqlite3 $(CACHEDIR)/kupo.sqlite3 "VACUUM;" - sqlite3 $(CACHEDIR)/kupo.sqlite3 "PRAGMA optimize;" + sqlite3 $(CACHEDIR)/kupo.sqlite3 "PRAGMA analysis_limit = 1000; PRAGMA optimize;" GZIP=-9 tar cvzf kupo.sqlite3-$(NETWORK).tar.gz --cd $(CACHEDIR) kupo.sqlite3 snapshot: kupo.sqlite3-$(NETWORK).tar.gz # Take database snapshots. Use NETWORK=XXX to specify target network. diff --git a/README.md b/README.md index 2515e2dc..1d2dd254 100644 --- a/README.md +++ b/README.md @@ -40,15 +40,16 @@ Finally, [discussions 💡][discussions] contains ongoing discussions regarding # Compatibility -Kupo | Cardano-node | Ogmios | Hydra ---- | --- | --- | --- -`v2.11.*` | `10.1.*`, `10.0.*` | `v6.*.*` | `0.20.0`, `0.21.0` -`v2.10.*` | `10.1.*`, `10.0.*`, `9.0.0` | `v6.*.*` | `0.16.0` -`v2.9.*` | `10.1.*`, `10.0.*`, `9.0.0` | `v6.*.*` | `0.16.0` -`v2.8.*` | `8.7.*` | `v6.*.*` | `0.13.0` -`v2.7.*` | `8.1.*`, `8.6.*` | `v6.*.*` | `0.13.0` -`v2.6.*` | `8.1.*` | `v6.*.*` | N/A -`v2.5.*` | `1.35.*`, `8.1.*` | `v5.*.*` | N/A +Kupo | Cardano-node | Ogmios | Hydra +--- | --- | --- | --- +`v2.12.*` | `11.1.*`, `11.2.*` | `v7.*.*`, `v6.*.*` | `0.20.0`, `0.21.0` +`v2.11.*` | `10.1.*`, `10.0.*` | `v6.*.*` | `0.20.0`, `0.21.0` +`v2.10.*` | `10.1.*`, `10.0.*`, `9.0.0` | `v6.*.*` | `0.16.0` +`v2.9.*` | `10.1.*`, `10.0.*`, `9.0.0` | `v6.*.*` | `0.16.0` +`v2.8.*` | `8.7.*` | `v6.*.*` | `0.13.0` +`v2.7.*` | `8.1.*`, `8.6.*` | `v6.*.*` | `0.13.0` +`v2.6.*` | `8.1.*` | `v6.*.*` | N/A +`v2.5.*` | `1.35.*`, `8.1.*` | `v5.*.*` | N/A # System Requirements diff --git a/benchmarks/README.md b/benchmarks/README.md index ed31b5db..4a25c5bb 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -1,24 +1,17 @@ # Kupo Benchmarks -This directory contains scripts that generate Kupo benchmarks. +This directory contains scripts that generate Kupo benchmarks, along with +latest results. -- [bench](./bench) is a Bash script that generates benchmark results -- [stats.hs](./stats.hs) is a Haskell script that performs statistical - comparisons of two benchmark data sets. - -There are three options for running the `bench` script: +## Latest results -1. `./bench mainnet` benchmarks Kupo against [mainnet](#mainnet) and prints - graphical results to the terminal. -2. `./bench preprod` benchmarks Kupo against [preprod](#preprod) and prints - graphical results to the terminal. -3. `./bench data` benchmarks Kupo against preprod and writes CSV output to - files for [comparative analysis](#comparative-analysis) +* [mainnet](./mainnet.md) benchmarks +* [preprod](./preprod.md) benchmarks +* [comparison](./comparison.md) of the last two versions -Current results of [mainnet](#mainnet) and [preprod](#preprod) benchmarks are -included below. +## Generating benchmarks -## Requirements +### Requirements - [`oha`][oha] and `runghc` must be available in PATH. - A Cardano node (mainnet or preprod accordingly) must be running locally and @@ -28,730 +21,25 @@ included below. flags: `--since origin --defer-db-indexes --prune-utxo --workdir --match "*"` and have been given time to roll forward and generate indexes. -## Mainnet - -- Hardware: MacBook Pro (2021), Apple M1 Max (16-core), 32 GB -- Version: 2.8.0 - -### Parameters - -Benchmarks are conducted on a local Kupo instance, using [`oha`][oha] with the -following parameters: - -- Concurrent clients: 8 -- Total requests: 30 - -### Dataset - -The data source used for the benchmarks is the pruned mainnet database matching on `*` from genesis until around slot = 115,816,544 (~ Feb 8th, 2024) -It contains a grand total of 11,406,779 indexed outputs, 91,641 unique token policies and 13,592,035 datums. - -### Results - -#### stake1uxqh9rn76n8nynsnyvf4ulndjv0srcc8jtvumut3989cqmgjt49h6 - -`[default]` - - - - - - -
-
-Total results:    315400
-Total data:     5.58 GiB
-
-Slowest: 6.0493 s -Fastest: 4.4276 s -Average: 5.3138 s -
-50% within: 5.4097 s -95% within: 5.9854 s -
-
-
-  4.428 [1] |■■■■
-  4.590 [5] |■■■■■■■■■■■■■■■■■■■■
-  4.752 [0] |
-  4.914 [0] |
-  5.076 [0] |
-  5.238 [1] |■■■■
-  5.401 [8] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-  5.563 [7] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-  5.725 [3] |■■■■■■■■■■■■
-  5.887 [2] |■■■■■■■■
-  6.049 [3] |■■■■■■■■■■■■
-
-
- -`?spent_after=98245654` - - - - - - -
-
-Total results:        9846
-Total data:     196.12 MiB
-
-Slowest: 0.7108 s -Fastest: 0.5789 s -Average: 0.6686 s -
-50% within: 0.6824 s -95% within: 0.7072 s -
-
-
-0.579 [1] |■■■■
-0.592 [0] |
-0.605 [5] |■■■■■■■■■■■■■■■■■■■■
-0.618 [0] |
-0.632 [0] |
-0.645 [0] |
-0.658 [0] |
-0.671 [3] |■■■■■■■■■■■■
-0.684 [7] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-0.698 [8] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-0.711 [6] |■■■■■■■■■■■■■■■■■■■■■■■■
-
-
- -#### 1d7f33bd23d85e1a25d87d86fac4f199c3197a2f7afeb662a0f34e1e.\* - -`[default]` - - - - - - -
-
-Total results:     54921
-Total data:     1.98 GiB
-
-Slowest: 2.7960 s -Fastest: 2.2751 s -Average: 2.5943 s -
-50% within: 2.6127 s -95% within: 2.7804 s -
-
-
-2.275 [1] |■■■■
-2.327 [5] |■■■■■■■■■■■■■■■■■■■■
-2.379 [0] |
-2.431 [0] |
-2.483 [0] |
-2.536 [0] |
-2.588 [3] |■■■■■■■■■■■■
-2.640 [8] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-2.692 [3] |■■■■■■■■■■■■
-2.744 [3] |■■■■■■■■■■■■
-2.796 [7] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-
-
- -`?created_before=98245654&spent_after=98764054` - - - - - - -
-
-Total results:       184
-Total data:     8.16 MiB
-
-Slowest: 1.2767 s -Fastest: 1.0572 s -Average: 1.2034 s -
-50% within: 1.2329 s -95% within: 1.2587 s -
-
-
-1.057 [1]  |■■
-1.079 [5]  |■■■■■■■■■■■■■
-1.101 [0]  |
-1.123 [0]  |
-1.145 [0]  |
-1.167 [0]  |
-1.189 [0]  |
-1.211 [0]  |
-1.233 [9]  |■■■■■■■■■■■■■■■■■■■■■■■■
-1.255 [12] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-1.277 [3]  |■■■■■■■■
-
-
- -#### addr1v94725lv4umktv89cg2t04qjn4qq3p6l6zegvtx5esu2zuqfd487u - -`[default]` - - - - - - -
-
-Total results:       8051
-Total data:     99.00 MiB
-
-Slowest: 0.1508 s -Fastest: 0.1002 s -Average: 0.1349 s -
-50% within: 0.1431 s -95% within: 0.1484 s -
-
-
-0.100 [1]  |■■■
-0.105 [2]  |■■■■■■
-0.110 [3]  |■■■■■■■■■
-0.115 [1]  |■■■
-0.120 [0]  |
-0.125 [0]  |
-0.131 [1]  |■■■
-0.136 [0]  |
-0.141 [4]  |■■■■■■■■■■■■
-0.146 [8]  |■■■■■■■■■■■■■■■■■■■■■■■■■
-0.151 [10] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-
-
- -`?created_after=98677654&created_before=98764054` - - - - - - -
-
-Total results:       156
-Total data:     1.83 MiB
-
-Slowest: 0.1374 s -Fastest: 0.0208 s -Average: 0.0616 s -
-50% within: 0.0475 s -95% within: 0.1370 s -
-
-
-0.021 [1]  |■
-0.032 [0]  |
-0.044 [3]  |■■■■
-0.056 [20] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-0.067 [1]  |■
-0.079 [0]  |
-0.091 [0]  |
-0.102 [0]  |
-0.114 [0]  |
-0.126 [0]  |
-0.137 [5]  |■■■■■■■■
-
-
- - -#### \*@4301551ce28e83ef1082432f57a13bbbd389f4628592b73d71ca19e8833c0eb7 - -`[default]` - - - - - - -
-
-Total results:         1
-Total data:     11.8 KiB
-
-Slowest: 0.0019 s -Fastest: 0.0003 s -Average: 0.0007 s -
-50% within: 0.0006 s -95% within: 0.0017 s -
-
-
-0.000 [1] |■■■
-0.000 [5] |■■■■■■■■■■■■■■■■■
-0.001 [9] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
-0.001 [4] |■■■■■■■■■■■■■■
-0.001 [4] |■■■■■■■■■■■■■■
-0.001 [5] |■■■■■■■■■■■■■■■■■
-0.001 [0] |
-0.001 [0] |
-0.002 [0] |
-0.002 [1] |■■■
-0.002 [1] |■■■
-
-
- -## Preprod - -### Specifications - -- Hardware: MacBook Pro (2024), Apple M4, 16 GB RAM, in a UTM VM. -- Kupo Version: 2.11.0 - -### Parameters - -Benchmarks are conducted on a local Kupo instance, using -[`oha`](https://github.com/hatoo/oha) with the following parameters - -- Concurrent clients: 8 -- Total requests: 30 - -### Dataset - -The data source used for the benchmarks is the pruned preprod database matching -on `*` from genesis until around slot = 119,440,417 (~ Apr 2, 2026) - -Installed Kupo and ran preprod cardano-node using -. - -Started Kupo with these arguments: - -```bash -mac-vm:~ $ kupo \ -> --node-socket $(brew --prefix)/var/cardano/preprod/node.socket \ -> --node-config $(brew --prefix)/etc/cardano/preprod/config.json \ -> --since origin --defer-db-indexes --prune-utxo --workdir ~/kupodb \ -> --match "*" -``` - -It contains a grand total of 18,859,595 indexed outputs, 13,681,102 unique -token policies and 4,486,825 datums. - -The above statistics were obtained using the following SQL queries: - -```sql -sqlite> SELECT COUNT(*) FROM inputs; -18859595 -sqlite> SELECT COUNT(*) FROM policies; -13681102 -sqlite> SELECT COUNT(*) FROM binary_data; -4486825 -``` - -### Results - -``` -Preprod benchmarks\n -http://127.0.0.1:1442/matches/stake_test1upyfx7klyd6lapdyqa0ku2ycgpnz9l8lmvp2ej989l6a69c0vnz0r -Summary: - Success rate: 100.00% - Total: 93.3370 ms - Slowest: 86.1881 ms - Fastest: 0.5590 ms - Average: 16.1459 ms - Requests/sec: 321.4158 - - Total data: 99.29 KiB - Size/request: 3.31 KiB - Size/sec: 1.04 MiB - -Response time histogram: - 0.559 ms [1] |■ - 9.122 ms [21] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 17.685 ms [0] | - 26.248 ms [0] | - 34.811 ms [1] |■ - 43.374 ms [4] |■■■■■■ - 51.936 ms [0] | - 60.499 ms [0] | - 69.062 ms [0] | - 77.625 ms [0] | - 86.188 ms [3] |■■■■ - -Response time distribution: - 10.00% in 1.4353 ms - 25.00% in 1.5288 ms - 50.00% in 1.7976 ms - 75.00% in 29.1718 ms - 90.00% in 84.9721 ms - 95.00% in 85.7780 ms - 99.00% in 86.1881 ms - 99.90% in 86.1881 ms - 99.99% in 86.1881 ms - - -Details (average, fastest, slowest): - DNS+dialup: 1.6987 ms, 1.5678 ms, 1.9138 ms - DNS-lookup: 0.5228 ms, 0.0017 ms, 0.7787 ms - -Status code distribution: - [200] 30 responses - -Total results - 6 - - -http://127.0.0.1:1442/matches/stake_test1upyfx7klyd6lapdyqa0ku2ycgpnz9l8lmvp2ej989l6a69c0vnz0r?spent_after=98245654 -Summary: - Success rate: 100.00% - Total: 9.8539 ms - Slowest: 4.0949 ms - Fastest: 0.4839 ms - Average: 2.0406 ms - Requests/sec: 3044.4876 - - Total data: 60 B - Size/request: 2 B - Size/sec: 5.95 KiB - -Response time histogram: - 0.484 ms [1] |■■■■ - 0.845 ms [0] | - 1.206 ms [0] | - 1.567 ms [7] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 1.928 ms [8] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 2.289 ms [4] |■■■■■■■■■■■■■■■■ - 2.651 ms [5] |■■■■■■■■■■■■■■■■■■■■ - 3.012 ms [1] |■■■■ - 3.373 ms [3] |■■■■■■■■■■■■ - 3.734 ms [0] | - 4.095 ms [1] |■■■■ +### Instructions -Response time distribution: - 10.00% in 1.3371 ms - 25.00% in 1.5647 ms - 50.00% in 1.8597 ms - 75.00% in 2.5123 ms - 90.00% in 3.1562 ms - 95.00% in 3.2308 ms - 99.00% in 4.0949 ms - 99.90% in 4.0949 ms - 99.99% in 4.0949 ms - - -Details (average, fastest, slowest): - DNS+dialup: 0.3973 ms, 0.2376 ms, 0.5734 ms - DNS-lookup: 0.1043 ms, 0.0023 ms, 0.2743 ms - -Status code distribution: - [200] 30 responses - -Total results - 0 - - -http://127.0.0.1:1442/matches/a9fc2c980e6beed499b91089ca06ad433961a6238690219b8021fe43.* -Summary: - Success rate: 100.00% - Total: 1.0966 10 sec - Slowest: 1.0965 10 sec - Fastest: 0.0179 10 sec - Average: 0.2045 10 sec - Requests/sec: 2.7358 - - Total data: 450.29 MiB - Size/request: 15.01 MiB - Size/sec: 41.06 MiB - -Response time histogram: - 0.018 10 sec [1] |■ - 0.126 10 sec [24] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 0.234 10 sec [0] | - 0.341 10 sec [0] | - 0.449 10 sec [0] | - 0.557 10 sec [0] | - 0.665 10 sec [0] | - 0.773 10 sec [0] | - 0.881 10 sec [0] | - 0.989 10 sec [0] | - 1.096 10 sec [5] |■■■■■■ - -Response time distribution: - 10.00% in 0.0180 10 sec - 25.00% in 0.0182 10 sec - 50.00% in 0.0281 10 sec - 75.00% in 0.0573 10 sec - 90.00% in 1.0883 10 sec - 95.00% in 1.0959 10 sec - 99.00% in 1.0965 10 sec - 99.90% in 1.0965 10 sec - 99.99% in 1.0965 10 sec - - -Details (average, fastest, slowest): - DNS+dialup: 0.0000 10 sec, 0.0000 10 sec, 0.0001 10 sec - DNS-lookup: 0.0000 10 sec, 0.0000 10 sec, 0.0000 10 sec - -Status code distribution: - [503] 25 responses - [200] 5 responses - -Total results - 63058 - - -http://127.0.0.1:1442/matches/a9fc2c980e6beed499b91089ca06ad433961a6238690219b8021fe43.*?created_before=98245654&spent_after=98764054 -Summary: - Success rate: 100.00% - Total: 1476.0095 ms - Slowest: 589.7672 ms - Fastest: 179.6779 ms - Average: 345.7223 ms - Requests/sec: 20.3251 - - Total data: 1.56 MiB - Size/request: 53.13 KiB - Size/sec: 1.05 MiB - -Response time histogram: - 179.678 ms [1] |■■ - 220.687 ms [14] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 261.696 ms [0] | - 302.705 ms [0] | - 343.714 ms [0] | - 384.723 ms [0] | - 425.732 ms [1] |■■ - 466.740 ms [3] |■■■■■■ - 507.749 ms [4] |■■■■■■■■■ - 548.758 ms [2] |■■■■ - 589.767 ms [5] |■■■■■■■■■■■ - -Response time distribution: - 10.00% in 180.2656 ms - 25.00% in 181.3761 ms - 50.00% in 418.4418 ms - 75.00% in 493.0484 ms - 90.00% in 580.2770 ms - 95.00% in 580.6327 ms - 99.00% in 589.7672 ms - 99.90% in 589.7672 ms - 99.99% in 589.7672 ms - - -Details (average, fastest, slowest): - DNS+dialup: 1.0679 ms, 0.3551 ms, 1.4733 ms - DNS-lookup: 0.2348 ms, 0.0027 ms, 0.5721 ms - -Status code distribution: - [200] 15 responses - [503] 15 responses - -Total results - 81 - - -http://127.0.0.1:1442/matches/addr_test1vzpwq95z3xyum8vqndgdd9mdnmafh3djcxnc6jemlgdmswcve6tkw -Summary: - Success rate: 100.00% - Total: 6.3064 sec - Slowest: 6.3052 sec - Fastest: 0.1800 sec - Average: 1.4032 sec - Requests/sec: 4.7570 - - Total data: 244.45 MiB - Size/request: 8.15 MiB - Size/sec: 38.76 MiB - -Response time histogram: - 0.180 sec [1] |■ - 0.793 sec [24] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 1.405 sec [0] | - 2.018 sec [0] | - 2.630 sec [0] | - 3.243 sec [0] | - 3.855 sec [0] | - 4.468 sec [0] | - 5.080 sec [0] | - 5.693 sec [0] | - 6.305 sec [5] |■■■■■■ - -Response time distribution: - 10.00% in 0.1814 sec - 25.00% in 0.3892 sec - 50.00% in 0.5507 sec - 75.00% in 0.5693 sec - 90.00% in 6.2281 sec - 95.00% in 6.2421 sec - 99.00% in 6.3052 sec - 99.90% in 6.3052 sec - 99.99% in 6.3052 sec - - -Details (average, fastest, slowest): - DNS+dialup: 0.0008 sec, 0.0003 sec, 0.0011 sec - DNS-lookup: 0.0001 sec, 0.0000 sec, 0.0002 sec - -Status code distribution: - [503] 25 responses - [200] 5 responses - -Total results - 86332 - - -http://127.0.0.1:1442/matches/addr_test1vzpwq95z3xyum8vqndgdd9mdnmafh3djcxnc6jemlgdmswcve6tkw?created_after=98677654&created_before=98764054 -Summary: - Success rate: 100.00% - Total: 294.6513 ms - Slowest: 217.1138 ms - Fastest: 32.5609 ms - Average: 56.6616 ms - Requests/sec: 101.8153 - - Total data: 476 B - Size/request: 15 B - Size/sec: 1.58 KiB - -Response time histogram: - 32.561 ms [1] |■ - 51.016 ms [25] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 69.471 ms [0] | - 87.927 ms [0] | - 106.382 ms [0] | - 124.837 ms [1] |■ - 143.293 ms [0] | - 161.748 ms [0] | - 180.203 ms [0] | - 198.659 ms [1] |■ - 217.114 ms [2] |■■ - -Response time distribution: - 10.00% in 35.2467 ms - 25.00% in 35.7046 ms - 50.00% in 36.7210 ms - 75.00% in 39.6945 ms - 90.00% in 189.8290 ms - 95.00% in 209.2978 ms - 99.00% in 217.1138 ms - 99.90% in 217.1138 ms - 99.99% in 217.1138 ms - - -Details (average, fastest, slowest): - DNS+dialup: 0.3957 ms, 0.1520 ms, 0.7768 ms - DNS-lookup: 0.0915 ms, 0.0022 ms, 0.1804 ms - -Status code distribution: - [200] 29 responses - [503] 1 responses - -Total results - 0 - - -http://127.0.0.1:1442/matches/*@bc40cc86ed43d84d3367a7ff2f4a401dbaed885af96edf1c8fd7379402735699 -Summary: - Success rate: 100.00% - Total: 35.1694 ms - Slowest: 30.0879 ms - Fastest: 0.5999 ms - Average: 2.9454 ms - Requests/sec: 853.0139 - - Total data: 60 B - Size/request: 2 B - Size/sec: 1.67 KiB - -Response time histogram: - 0.600 ms [1] |■ - 3.549 ms [25] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 6.498 ms [3] |■■■ - 9.446 ms [0] | - 12.395 ms [0] | - 15.344 ms [0] | - 18.293 ms [0] | - 21.242 ms [0] | - 24.190 ms [0] | - 27.139 ms [0] | - 30.088 ms [1] |■ - -Response time distribution: - 10.00% in 0.9084 ms - 25.00% in 1.4329 ms - 50.00% in 1.8232 ms - 75.00% in 2.8876 ms - 90.00% in 4.0606 ms - 95.00% in 4.6730 ms - 99.00% in 30.0879 ms - 99.90% in 30.0879 ms - 99.99% in 30.0879 ms - - -Details (average, fastest, slowest): - DNS+dialup: 0.4867 ms, 0.3432 ms, 0.7280 ms - DNS-lookup: 0.0316 ms, 0.0018 ms, 0.1201 ms - -Status code distribution: - [200] 30 responses - -Total results - 0 - - -http://127.0.0.1:1442/matches/*?spent_after=98245654&spent_before=98245660 -Summary: - Success rate: 100.00% - Total: 19.0280 ms - Slowest: 11.5676 ms - Fastest: 2.3466 ms - Average: 4.2811 ms - Requests/sec: 1576.6274 - - Total data: 297.89 KiB - Size/request: 9.93 KiB - Size/sec: 15.29 MiB - -Response time histogram: - 2.347 ms [1] |■■ - 3.269 ms [13] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ - 4.191 ms [5] |■■■■■■■■■■■■ - 5.113 ms [4] |■■■■■■■■■ - 6.035 ms [2] |■■■■ - 6.957 ms [3] |■■■■■■■ - 7.879 ms [0] | - 8.801 ms [0] | - 9.723 ms [1] |■■ - 10.646 ms [0] | - 11.568 ms [1] |■■ - -Response time distribution: - 10.00% in 2.5770 ms - 25.00% in 2.8856 ms - 50.00% in 3.5824 ms - 75.00% in 5.0763 ms - 90.00% in 6.4232 ms - 95.00% in 9.3081 ms - 99.00% in 11.5676 ms - 99.90% in 11.5676 ms - 99.99% in 11.5676 ms - - -Details (average, fastest, slowest): - DNS+dialup: 0.3806 ms, 0.2884 ms, 0.5444 ms - DNS-lookup: 0.0488 ms, 0.0027 ms, 0.1155 ms +- [bench](./bench) is a Bash script that generates benchmark results +- [stats.hs](./stats.hs) is a Haskell script that performs statistical + comparisons of two benchmark data sets. -Status code distribution: - [200] 30 responses +There are three options for running the `bench` script: -Total results - 15 -``` +1. `./bench mainnet` benchmarks Kupo against mainnet and prints graphical + results to the terminal. +2. `./bench preprod` benchmarks Kupo against preprod and prints graphical + results to the terminal. +3. `./bench data` benchmarks Kupo against preprod and writes CSV output to + files for [comparative analysis](#comparative-analysis) -## Comparative analysis +### Comparative analysis -It is possible to compare two versions of Kupo. This is used by the developers to compare a future version with the last version. +It is possible to compare two versions of Kupo. This is used by the developers +to compare a future version with the last version. The process is as follows: diff --git a/benchmarks/comparison.md b/benchmarks/comparison.md new file mode 100644 index 00000000..1fd069df --- /dev/null +++ b/benchmarks/comparison.md @@ -0,0 +1,48 @@ +# Comparison of last two versions + +Here are the results of a comparative analysis of Kupo 2.11.0 (control) and +Kupo 2.12.0 (experimental). The experiment was done twice. + +Date: 2026-07-22. + +First time: +``` +Comparing: +data/20260722-070332 (s1: experimental group) +data/20260722-065951 (s2: control group) +Common datasets: +1 2 3 4 5 6 7 8 +Significance level: α = 0.05 +1: errors (s1/s2): (0/0); comparison: not significant +2: errors (s1/s2): (0/0); comparison: not significant +3: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.0916194901341525 +4: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.0535370652888765 +5: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.1398644489218612 +6: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.5449497464477424 +7: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.1963714961632728 +8: errors (s1/s2): (0/0); comparison: s1 faster by factor 4.8343761442035224e-4 +``` + +Second time: +``` +Comparing: +data/20260722-071609 (s1: experimental group) +data/20260722-071055 (s2: control group) +Common datasets: +1 2 3 4 5 6 7 8 +Significance level: α = 0.05 +1: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.100916485402807 +2: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.0708009466150419 +3: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.0582589486699308 +4: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.058555515473119 +5: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.084723814838676 +6: errors (s1/s2): (0/0); comparison: s1 slower by factor 1.2807685516569087 +7: errors (s1/s2): (0/0); comparison: not significant +8: errors (s1/s2): (0/0); comparison: s1 faster by factor 4.539446387978876e-4 +``` + +This shows fairly consistently that in general, the new version is very +slightly slower, but specifically in the case of dataset 8 the new version is +blazingly faster (cf. [Issue 194][issue194]). + +[issue194]: https://github.com/CardanoSolutions/kupo/issues/194 diff --git a/benchmarks/mainnet.md b/benchmarks/mainnet.md new file mode 100644 index 00000000..4e629a75 --- /dev/null +++ b/benchmarks/mainnet.md @@ -0,0 +1,379 @@ +# Kupo mainnet benchmarks + +## Parameters + +* Date: 2026-08-20 +* Version: 2.12.0 +* Hardware: VM with 4 cores and 24G RAM +* Network: mainnet at slot 195643770 +* SQLite dataset: +``` +sqlite> SELECT COUNT(*) FROM inputs; +╭──────────╮ +│ COUNT(*) │ +╞══════════╡ +│ 11171749 │ +╰──────────╯ +sqlite> SELECT COUNT(*) FROM policies; +╭──────────╮ +│ COUNT(*) │ +╞══════════╡ +│ 11207267 │ +╰──────────╯ +sqlite> SELECT COUNT(*) FROM binary_data; +╭──────────╮ +│ COUNT(*) │ +╞══════════╡ +│ 797908 │ +╰──────────╯ +``` + +## Results + +``` +http://127.0.0.1:1442/matches/stake1uxqh9rn76n8nynsnyvf4ulndjv0srcc8jtvumut3989cqmgjt49h6 +Summary: + Success rate: 100.00% + Total: 2.1629 10 sec + Slowest: 2.1627 10 sec + Fastest: 0.0176 10 sec + Average: 0.3690 10 sec + Requests/sec: 1.3870 + + Total data: 531.49 MiB + Size/request: 17.72 MiB + Size/sec: 24.57 MiB + +Response time histogram: + 0.018 10 sec [1] |■ + 0.232 10 sec [24] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 0.447 10 sec [0] | + 0.661 10 sec [0] | + 0.876 10 sec [0] | + 1.090 10 sec [0] | + 1.305 10 sec [0] | + 1.519 10 sec [0] | + 1.734 10 sec [0] | + 1.948 10 sec [0] | + 2.163 10 sec [5] |■■■■■■ + +Response time distribution: + 10.00% in 0.0176 10 sec + 25.00% in 0.0176 10 sec + 50.00% in 0.0177 10 sec + 75.00% in 0.0185 10 sec + 90.00% in 2.1166 10 sec + 95.00% in 2.1396 10 sec + 99.00% in 2.1627 10 sec + 99.90% in 2.1627 10 sec + 99.99% in 2.1627 10 sec + + +Details (average, fastest, slowest): + DNS+dialup: 0.0001 10 sec, 0.0001 10 sec, 0.0001 10 sec + DNS-lookup: 0.0000 10 sec, 0.0000 10 sec, 0.0000 10 sec + +Status code distribution: + [503] 25 responses + [200] 5 responses + +Total results + 176383 + + +http://127.0.0.1:1442/matches/stake1uxqh9rn76n8nynsnyvf4ulndjv0srcc8jtvumut3989cqmgjt49h6?spent_after=98245654 +Summary: + Success rate: 100.00% + Total: 1352.2159 ms + Slowest: 629.9416 ms + Fastest: 177.7128 ms + Average: 311.1133 ms + Requests/sec: 22.1858 + + Total data: 18.33 KiB + Size/request: 625 B + Size/sec: 13.55 KiB + +Response time histogram: + 177.713 ms [1] |■■ + 222.936 ms [14] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 268.159 ms [0] | + 313.381 ms [0] | + 358.604 ms [2] |■■■■ + 403.827 ms [3] |■■■■■■ + 449.050 ms [6] |■■■■■■■■■■■■■ + 494.273 ms [2] |■■■■ + 539.496 ms [0] | + 584.719 ms [0] | + 629.942 ms [2] |■■■■ + +Response time distribution: + 10.00% in 179.2388 ms + 25.00% in 181.9347 ms + 50.00% in 316.0035 ms + 75.00% in 427.2687 ms + 90.00% in 468.5867 ms + 95.00% in 629.6032 ms + 99.00% in 629.9416 ms + 99.90% in 629.9416 ms + 99.99% in 629.9416 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.1632 ms, 0.0660 ms, 0.2846 ms + DNS-lookup: 0.0165 ms, 0.0028 ms, 0.0494 ms + +Status code distribution: + [200] 15 responses + [503] 15 responses + +Total results + 1 + + +http://127.0.0.1:1442/matches/1d7f33bd23d85e1a25d87d86fac4f199c3197a2f7afeb662a0f34e1e.* +Summary: + Success rate: 100.00% + Total: 2.5634 10 sec + Slowest: 2.5634 10 sec + Fastest: 0.0176 10 sec + Average: 0.4397 10 sec + Requests/sec: 1.1703 + + Total data: 311.78 MiB + Size/request: 10.39 MiB + Size/sec: 12.16 MiB + +Response time histogram: + 0.018 10 sec [1] |■ + 0.272 10 sec [24] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 0.527 10 sec [0] | + 0.781 10 sec [0] | + 1.036 10 sec [0] | + 1.290 10 sec [0] | + 1.545 10 sec [0] | + 1.800 10 sec [0] | + 2.054 10 sec [0] | + 2.309 10 sec [0] | + 2.563 10 sec [5] |■■■■■■ + +Response time distribution: + 10.00% in 0.0176 10 sec + 25.00% in 0.0176 10 sec + 50.00% in 0.0177 10 sec + 75.00% in 0.0179 10 sec + 90.00% in 2.5526 10 sec + 95.00% in 2.5582 10 sec + 99.00% in 2.5634 10 sec + 99.90% in 2.5634 10 sec + 99.99% in 2.5634 10 sec + + +Details (average, fastest, slowest): + DNS+dialup: 0.0000 10 sec, 0.0000 10 sec, 0.0000 10 sec + DNS-lookup: 0.0000 10 sec, 0.0000 10 sec, 0.0000 10 sec + +Status code distribution: + [503] 25 responses + [200] 5 responses + +Total results + 48923 + + +http://127.0.0.1:1442/matches/1d7f33bd23d85e1a25d87d86fac4f199c3197a2f7afeb662a0f34e1e.*?created_before=98245654&spent_after=98764054 +Summary: + Success rate: 100.00% + Total: 1667.3463 ms + Slowest: 963.4973 ms + Fastest: 176.5719 ms + Average: 382.0051 ms + Requests/sec: 17.9927 + + Total data: 23.12 KiB + Size/request: 789 B + Size/sec: 13.87 KiB + +Response time histogram: + 176.572 ms [1] |■ + 255.264 ms [19] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 333.957 ms [0] | + 412.649 ms [0] | + 491.342 ms [0] | + 570.035 ms [1] |■ + 648.727 ms [1] |■ + 727.420 ms [1] |■ + 806.112 ms [2] |■■■ + 884.805 ms [2] |■■■ + 963.497 ms [3] |■■■■■ + +Response time distribution: + 10.00% in 178.1230 ms + 25.00% in 179.9686 ms + 50.00% in 182.3605 ms + 75.00% in 693.5092 ms + 90.00% in 910.1717 ms + 95.00% in 915.7735 ms + 99.00% in 963.4973 ms + 99.90% in 963.4973 ms + 99.99% in 963.4973 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.1091 ms, 0.0499 ms, 0.2106 ms + DNS-lookup: 0.0106 ms, 0.0025 ms, 0.0232 ms + +Status code distribution: + [503] 20 responses + [200] 10 responses + +Total results + 2 + + +http://127.0.0.1:1442/matches/addr1v94725lv4umktv89cg2t04qjn4qq3p6l6zegvtx5esu2zuqfd487u +Summary: + Success rate: 100.00% + Total: 29.1220 ms + Slowest: 28.1801 ms + Fastest: 3.3902 ms + Average: 6.2361 ms + Requests/sec: 1030.1504 + + Total data: 298.36 KiB + Size/request: 9.95 KiB + Size/sec: 10.01 MiB + +Response time histogram: + 3.390 ms [1] |■ + 5.869 ms [18] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 8.348 ms [10] |■■■■■■■■■■■■■■■■■ + 10.827 ms [0] | + 13.306 ms [0] | + 15.785 ms [0] | + 18.264 ms [0] | + 20.743 ms [0] | + 23.222 ms [0] | + 25.701 ms [0] | + 28.180 ms [1] |■ + +Response time distribution: + 10.00% in 4.1614 ms + 25.00% in 4.5325 ms + 50.00% in 5.3030 ms + 75.00% in 6.4684 ms + 90.00% in 8.0275 ms + 95.00% in 8.1721 ms + 99.00% in 28.1801 ms + 99.90% in 28.1801 ms + 99.99% in 28.1801 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.1021 ms, 0.0450 ms, 0.1906 ms + DNS-lookup: 0.0112 ms, 0.0019 ms, 0.0278 ms + +Status code distribution: + [200] 30 responses + +Total results + 25 + + +http://127.0.0.1:1442/matches/addr1v94725lv4umktv89cg2t04qjn4qq3p6l6zegvtx5esu2zuqfd487u?created_after=98677654&created_before=98764054 +Summary: + Success rate: 100.00% + Total: 30.6304 ms + Slowest: 27.6520 ms + Fastest: 0.8582 ms + Average: 4.1921 ms + Requests/sec: 979.4186 + + Total data: 60 B + Size/request: 2 B + Size/sec: 1.91 KiB + +Response time histogram: + 0.858 ms [1] |■ + 3.538 ms [26] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 6.217 ms [0] | + 8.896 ms [0] | + 11.576 ms [0] | + 14.255 ms [0] | + 16.934 ms [0] | + 19.614 ms [0] | + 22.293 ms [0] | + 24.973 ms [0] | + 27.652 ms [3] |■■■ + +Response time distribution: + 10.00% in 1.0317 ms + 25.00% in 1.2705 ms + 50.00% in 1.7218 ms + 75.00% in 2.1514 ms + 90.00% in 27.0475 ms + 95.00% in 27.5343 ms + 99.00% in 27.6520 ms + 99.90% in 27.6520 ms + 99.99% in 27.6520 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.0887 ms, 0.0412 ms, 0.1493 ms + DNS-lookup: 0.0125 ms, 0.0021 ms, 0.0326 ms + +Status code distribution: + [200] 30 responses + +Total results + 0 + + +http://127.0.0.1:1442/matches/*@4301551ce28e83ef1082432f57a13bbbd389f4628592b73d71ca19e8833c0eb7 +Summary: + Success rate: 100.00% + Total: 33.6091 ms + Slowest: 27.9180 ms + Fastest: 0.9648 ms + Average: 4.3417 ms + Requests/sec: 892.6157 + + Total data: 60 B + Size/request: 2 B + Size/sec: 1.74 KiB + +Response time histogram: + 0.965 ms [1] |■ + 3.660 ms [26] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 6.355 ms [0] | + 9.051 ms [0] | + 11.746 ms [0] | + 14.441 ms [0] | + 17.137 ms [0] | + 19.832 ms [0] | + 22.527 ms [0] | + 25.223 ms [0] | + 27.918 ms [3] |■■■ + +Response time distribution: + 10.00% in 1.0897 ms + 25.00% in 1.3425 ms + 50.00% in 1.9378 ms + 75.00% in 2.3490 ms + 90.00% in 26.6906 ms + 95.00% in 27.4057 ms + 99.00% in 27.9180 ms + 99.90% in 27.9180 ms + 99.99% in 27.9180 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.1012 ms, 0.0429 ms, 0.1671 ms + DNS-lookup: 0.0135 ms, 0.0019 ms, 0.0353 ms + +Status code distribution: + [200] 30 responses + +Total results + 0 +``` diff --git a/benchmarks/preprod.md b/benchmarks/preprod.md new file mode 100644 index 00000000..44fb1be6 --- /dev/null +++ b/benchmarks/preprod.md @@ -0,0 +1,427 @@ +# Kupo preprod benchmarks + +## Parameters + +* Date: 2026-07-22 +* Version: 2.12.0 +* Hardware: MacBook Pro (2024), Apple M4, Kupo and cardano-node in VM with 6 cores and 12G RAM +* Network: preprod at slot 129024056 +* SQLite dataset: +``` +sqlite> SELECT COUNT(*) FROM inputs; +╭──────────╮ +│ COUNT(*) │ +╞══════════╡ +│ 4285139 │ +╰──────────╯ +sqlite> SELECT COUNT(*) FROM policies; +╭──────────╮ +│ COUNT(*) │ +╞══════════╡ +│ 2025436 │ +╰──────────╯ +sqlite> SELECT COUNT(*) FROM binary_data; +╭──────────╮ +│ COUNT(*) │ +╞══════════╡ +│ 2914125 │ +╰──────────╯ +``` + +## Results + +``` +http://127.0.0.1:1442/matches/stake_test1upyfx7klyd6lapdyqa0ku2ycgpnz9l8lmvp2ej989l6a69c0vnz0r +Summary: + Success rate: 100.00% + Total: 35.0280 ms + Slowest: 34.2389 ms + Fastest: 0.9850 ms + Average: 5.8548 ms + Requests/sec: 856.4587 + + Total data: 40.14 KiB + Size/request: 1.34 KiB + Size/sec: 1.12 MiB + +Response time histogram: + 0.985 ms [1] |■ + 4.310 ms [21] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 7.636 ms [2] |■■■ + 10.961 ms [3] |■■■■ + 14.287 ms [0] | + 17.612 ms [0] | + 20.937 ms [0] | + 24.263 ms [0] | + 27.588 ms [0] | + 30.914 ms [0] | + 34.239 ms [3] |■■■■ + +Response time distribution: + 10.00% in 1.3626 ms + 25.00% in 1.5877 ms + 50.00% in 1.6696 ms + 75.00% in 7.2974 ms + 90.00% in 32.9061 ms + 95.00% in 34.0759 ms + 99.00% in 34.2389 ms + 99.90% in 34.2389 ms + 99.99% in 34.2389 ms + + +Details (average, fastest, slowest): + DNS+dialup: 1.2139 ms, 0.4027 ms, 1.8513 ms + DNS-lookup: 0.0519 ms, 0.0030 ms, 0.1490 ms + +Status code distribution: + [200] 30 responses + +Total results + 3 + + +http://127.0.0.1:1442/matches/stake_test1upyfx7klyd6lapdyqa0ku2ycgpnz9l8lmvp2ej989l6a69c0vnz0r?spent_after=98245654 +Summary: + Success rate: 100.00% + Total: 33.8104 ms + Slowest: 32.6215 ms + Fastest: 0.9239 ms + Average: 5.1063 ms + Requests/sec: 887.3015 + + Total data: 60 B + Size/request: 2 B + Size/sec: 1.73 KiB + +Response time histogram: + 0.924 ms [1] |■ + 4.094 ms [24] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 7.263 ms [2] |■■ + 10.433 ms [0] | + 13.603 ms [0] | + 16.773 ms [0] | + 19.942 ms [0] | + 23.112 ms [0] | + 26.282 ms [0] | + 29.452 ms [1] |■ + 32.622 ms [2] |■■ + +Response time distribution: + 10.00% in 1.2452 ms + 25.00% in 1.5062 ms + 50.00% in 2.2822 ms + 75.00% in 2.9347 ms + 90.00% in 29.3550 ms + 95.00% in 30.7791 ms + 99.00% in 32.6215 ms + 99.90% in 32.6215 ms + 99.99% in 32.6215 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.2988 ms, 0.1614 ms, 0.4678 ms + DNS-lookup: 0.0120 ms, 0.0015 ms, 0.0507 ms + +Status code distribution: + [200] 30 responses + +Total results + 0 + + +http://127.0.0.1:1442/matches/a9fc2c980e6beed499b91089ca06ad433961a6238690219b8021fe43.* +Summary: + Success rate: 100.00% + Total: 3.2038 sec + Slowest: 1.5532 sec + Fastest: 0.1804 sec + Average: 0.7470 sec + Requests/sec: 9.3638 + + Total data: 144.23 MiB + Size/request: 4.81 MiB + Size/sec: 45.02 MiB + +Response time histogram: + 0.180 sec [1] |■■■■■ + 0.318 sec [5] |■■■■■■■■■■■■■■■■■■■■■■■■■■ + 0.455 sec [6] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 0.592 sec [3] |■■■■■■■■■■■■■■■■ + 0.729 sec [1] |■■■■■ + 0.867 sec [0] | + 1.004 sec [4] |■■■■■■■■■■■■■■■■■■■■■ + 1.141 sec [3] |■■■■■■■■■■■■■■■■ + 1.279 sec [0] | + 1.416 sec [4] |■■■■■■■■■■■■■■■■■■■■■ + 1.553 sec [3] |■■■■■■■■■■■■■■■■ + +Response time distribution: + 10.00% in 0.2021 sec + 25.00% in 0.3300 sec + 50.00% in 0.6366 sec + 75.00% in 1.1270 sec + 90.00% in 1.4292 sec + 95.00% in 1.4357 sec + 99.00% in 1.5532 sec + 99.90% in 1.5532 sec + 99.99% in 1.5532 sec + + +Details (average, fastest, slowest): + DNS+dialup: 0.0005 sec, 0.0002 sec, 0.0009 sec + DNS-lookup: 0.0000 sec, 0.0000 sec, 0.0001 sec + +Status code distribution: + [503] 16 responses + [200] 14 responses + +Total results + 7278 + + +http://127.0.0.1:1442/matches/a9fc2c980e6beed499b91089ca06ad433961a6238690219b8021fe43.*?created_before=98245654&spent_after=98764054 +Summary: + Success rate: 100.00% + Total: 439.6751 ms + Slowest: 255.5334 ms + Fastest: 63.0732 ms + Average: 106.3578 ms + Requests/sec: 68.2322 + + Total data: 2.09 KiB + Size/request: 71 B + Size/sec: 4.75 KiB + +Response time histogram: + 63.073 ms [1] |■■ + 82.319 ms [12] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 101.565 ms [6] |■■■■■■■■■■■■■■■■ + 120.811 ms [5] |■■■■■■■■■■■■■ + 140.057 ms [0] | + 159.303 ms [0] | + 178.549 ms [0] | + 197.795 ms [5] |■■■■■■■■■■■■■ + 217.041 ms [0] | + 236.287 ms [0] | + 255.533 ms [1] |■■ + +Response time distribution: + 10.00% in 63.7731 ms + 25.00% in 77.8454 ms + 50.00% in 85.2879 ms + 75.00% in 109.7108 ms + 90.00% in 183.5553 ms + 95.00% in 183.6082 ms + 99.00% in 255.5334 ms + 99.90% in 255.5334 ms + 99.99% in 255.5334 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.7236 ms, 0.0923 ms, 3.6836 ms + DNS-lookup: 0.0513 ms, 0.0019 ms, 0.1934 ms + +Status code distribution: + [200] 25 responses + [503] 5 responses + +Total results + 0 + + +http://127.0.0.1:1442/matches/addr_test1vzpwq95z3xyum8vqndgdd9mdnmafh3djcxnc6jemlgdmswcve6tkw +Summary: + Success rate: 100.00% + Total: 3.2739 sec + Slowest: 1.2784 sec + Fastest: 0.2520 sec + Average: 0.7904 sec + Requests/sec: 9.1635 + + Total data: 111.79 MiB + Size/request: 3.73 MiB + Size/sec: 34.14 MiB + +Response time histogram: + 0.252 sec [1] |■■■■■ + 0.355 sec [2] |■■■■■■■■■■ + 0.457 sec [0] | + 0.560 sec [2] |■■■■■■■■■■ + 0.663 sec [5] |■■■■■■■■■■■■■■■■■■■■■■■■■■ + 0.765 sec [4] |■■■■■■■■■■■■■■■■■■■■■ + 0.868 sec [5] |■■■■■■■■■■■■■■■■■■■■■■■■■■ + 0.970 sec [1] |■■■■■ + 1.073 sec [6] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 1.176 sec [1] |■■■■■ + 1.278 sec [3] |■■■■■■■■■■■■■■■■ + +Response time distribution: + 10.00% in 0.4831 sec + 25.00% in 0.6127 sec + 50.00% in 0.8241 sec + 75.00% in 1.0060 sec + 90.00% in 1.2101 sec + 95.00% in 1.2608 sec + 99.00% in 1.2784 sec + 99.90% in 1.2784 sec + 99.99% in 1.2784 sec + + +Details (average, fastest, slowest): + DNS+dialup: 0.0004 sec, 0.0002 sec, 0.0007 sec + DNS-lookup: 0.0000 sec, 0.0000 sec, 0.0001 sec + +Status code distribution: + [200] 22 responses + [503] 8 responses + +Total results + 12508 + + +http://127.0.0.1:1442/matches/addr_test1vzpwq95z3xyum8vqndgdd9mdnmafh3djcxnc6jemlgdmswcve6tkw?created_after=98677654&created_before=98764054 +Summary: + Success rate: 100.00% + Total: 198.5826 ms + Slowest: 198.0647 ms + Fastest: 14.6098 ms + Average: 37.6207 ms + Requests/sec: 151.0706 + + Total data: 60 B + Size/request: 2 B + Size/sec: 302 B + +Response time histogram: + 14.610 ms [1] |■ + 32.955 ms [26] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 51.301 ms [0] | + 69.646 ms [0] | + 87.992 ms [0] | + 106.337 ms [0] | + 124.683 ms [0] | + 143.028 ms [0] | + 161.374 ms [0] | + 179.719 ms [0] | + 198.065 ms [3] |■■■ + +Response time distribution: + 10.00% in 17.5649 ms + 25.00% in 18.2926 ms + 50.00% in 19.7290 ms + 75.00% in 21.7135 ms + 90.00% in 197.6395 ms + 95.00% in 197.8989 ms + 99.00% in 198.0647 ms + 99.90% in 198.0647 ms + 99.99% in 198.0647 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.2909 ms, 0.1358 ms, 0.4638 ms + DNS-lookup: 0.0129 ms, 0.0022 ms, 0.0335 ms + +Status code distribution: + [200] 30 responses + +Total results + 0 + + +http://127.0.0.1:1442/matches/*@bc40cc86ed43d84d3367a7ff2f4a401dbaed885af96edf1c8fd7379402735699 +Summary: + Success rate: 100.00% + Total: 32.4974 ms + Slowest: 28.7838 ms + Fastest: 1.0973 ms + Average: 4.8969 ms + Requests/sec: 923.1501 + + Total data: 60 B + Size/request: 2 B + Size/sec: 1.80 KiB + +Response time histogram: + 1.097 ms [1] |■ + 3.866 ms [23] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 6.635 ms [3] |■■■■ + 9.403 ms [0] | + 12.172 ms [0] | + 14.941 ms [0] | + 17.709 ms [0] | + 20.478 ms [0] | + 23.247 ms [0] | + 26.015 ms [0] | + 28.784 ms [3] |■■■■ + +Response time distribution: + 10.00% in 1.2584 ms + 25.00% in 1.4224 ms + 50.00% in 1.9372 ms + 75.00% in 3.2904 ms + 90.00% in 27.9656 ms + 95.00% in 28.6241 ms + 99.00% in 28.7838 ms + 99.90% in 28.7838 ms + 99.99% in 28.7838 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.6321 ms, 0.3371 ms, 0.8137 ms + DNS-lookup: 0.0081 ms, 0.0014 ms, 0.0195 ms + +Status code distribution: + [200] 30 responses + +Total results + 0 + + +http://127.0.0.1:1442/matches/*?spent_after=98245654&spent_before=98245660 +Summary: + Success rate: 100.00% + Total: 34.4610 ms + Slowest: 28.3141 ms + Fastest: 1.7580 ms + Average: 4.5104 ms + Requests/sec: 870.5493 + + Total data: 60 B + Size/request: 2 B + Size/sec: 1.70 KiB + +Response time histogram: + 1.758 ms [1] |■ + 4.414 ms [24] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ + 7.069 ms [3] |■■■■ + 9.725 ms [0] | + 12.380 ms [0] | + 15.036 ms [0] | + 17.692 ms [0] | + 20.347 ms [0] | + 23.003 ms [0] | + 25.658 ms [0] | + 28.314 ms [2] |■■ + +Response time distribution: + 10.00% in 1.9880 ms + 25.00% in 2.0182 ms + 50.00% in 2.5250 ms + 75.00% in 3.3060 ms + 90.00% in 6.0600 ms + 95.00% in 27.6762 ms + 99.00% in 28.3141 ms + 99.90% in 28.3141 ms + 99.99% in 28.3141 ms + + +Details (average, fastest, slowest): + DNS+dialup: 0.6229 ms, 0.1901 ms, 1.7914 ms + DNS-lookup: 0.0165 ms, 0.0025 ms, 0.0550 ms + +Status code distribution: + [200] 30 responses + +Total results + 0 +``` diff --git a/docs/api/nightly.yaml b/docs/api/nightly.yaml index d89546d9..a06ded33 100644 --- a/docs/api/nightly.yaml +++ b/docs/api/nightly.yaml @@ -273,6 +273,25 @@ info: $ man kupo ``` + # Custom database indexes + + Kupo supports custom database indexes, provided by environment variable. + Hence, any environment variable prefixed with `KUPO_INDEX_` will be parsed + and interpreted as a custom database index, managed with the pre-defined + indexes. + + For example, you can add a custom index `inputsByPaymentCredentialUnspent` + for matching unspent inputs by payment cred by setting the following + environment variable: + + ```env + KUPO_INDEX_inputsByPaymentCredentialUnspent="inputs(payment_credential COLLATE NOCASE) WHERE spent_at IS NULL" + ``` + + Use this carefully, as too many indexes may greatly impact the database sync performances and also other queries. + + Existing indexes and the overall database internal schema is [available here](https://github.com/CardanoSolutions/kupo/tree/master/db#overview). + # Patterns ## Overview diff --git a/docs/api/v2.10.0.yaml b/docs/api/v2.12.0.yaml similarity index 92% rename from docs/api/v2.10.0.yaml rename to docs/api/v2.12.0.yaml index 90ad286a..c17fe644 100644 --- a/docs/api/v2.10.0.yaml +++ b/docs/api/v2.12.0.yaml @@ -5,7 +5,7 @@ servers: info: title: Kupo - version: v2.10.0 + version: v2.12.0 license: name: MPL-2.0 url: https://raw.githubusercontent.com/cardanosolutions/kupo/master/LICENSE @@ -81,8 +81,8 @@ info: Make sure to have [nix](https://nixos.org/download.html#nix-install-linux) installed with a cache: ``` - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= - substituters = https://cache.zw3rk.com/ https://cache.nixos.org/ + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= + substituters = https://cache.iog.io/ https://cache.nixos.org/ ``` On MacOS, you'll need to install `libffi` and `bzip2` if they aren't already installed. @@ -273,6 +273,25 @@ info: $ man kupo ``` + # Custom database indexes + + Kupo supports custom database indexes, provided by environment variable. + Hence, any environment variable prefixed with `KUPO_INDEX_` will be parsed + and interpreted as a custom database index, managed with the pre-defined + indexes. + + For example, you can add a custom index `inputsByPaymentCredentialUnspent` + for matching unspent inputs by payment cred by setting the following + environment variable: + + ```env + KUPO_INDEX_inputsByPaymentCredentialUnspent="inputs(payment_credential COLLATE NOCASE) WHERE spent_at IS NULL" + ``` + + Use this carefully, as too many indexes may greatly impact the database sync performances and also other queries. + + Existing indexes and the overall database internal schema is [available here](https://github.com/CardanoSolutions/kupo/tree/master/db#overview). + # Patterns ## Overview @@ -569,7 +588,7 @@ info: | Last Allegra block | N/A | N/A | | Last Mary block | N/A | N/A | | Last Alonzo block | 259180 | 0ad91d3bbe350b1cfa05b13dba5263c47c5eca4f97b3a3105eba96416785a487 | - | Last Conway block | 55814394 | bdd4baa2c81d0500a695f836332193ea06c2ce364e585057142220fc0782144c | + | Last Babbage block | 55814394 | bdd4baa2c81d0500a695f836332193ea06c2ce364e585057142220fc0782144c | | Last Conway block | N/A | N/A | See configuration files for Preview. @@ -1260,6 +1279,31 @@ components: 1220099e5e430475c219518179efc7e6c8289db028904834025d5b086: 231 289db028904834025d5b085d5b08661220099e5e430475c2195181796.08661220099e: 1 + ValueAsString: + type: object + description: A (multi-asset) value of a transaction's output. + additionalProperties: false + required: + - coins + properties: + coins: + type: string + description: A quantity of Lovelace, encoded as string when 'asset-quantity=string' is specified as media-type parameter. + example: "42" + assets: + type: object + description: A _key:value_ map of asset identifier → quantity. + propertyNames: + type: string + pattern: ^[a-f0-9]{56}(.[a-f0-9]{2,64})?$ + additionalProperties: + x-additionalPropertiesName: "{policy-id}.{asset-name}" + type: string + description: A quantity of some asset, encoded as string when 'asset-quantity=string' is specified as media-type parameter. + example: + 1220099e5e430475c219518179efc7e6c8289db028904834025d5b086: "231" + 289db028904834025d5b085d5b08661220099e5e430475c2195181796.08661220099e: "1" + Wildcard: type: string title: Wildcard @@ -1317,6 +1361,58 @@ components: - $ref: "#/components/schemas/SpentAt" - type: "null" + MatchQuantityAsString: + type: object + additionalProperties: false + required: + - transaction_index + - transaction_id + - output_index + - address + - value + - datum_hash + - script_hash + - created_at + - spent_at + properties: + transaction_index: + $ref: "#/components/schemas/TransactionIndex" + transaction_id: + $ref: "#/components/schemas/TransactionId" + output_index: + $ref: "#/components/schemas/OutputIndex" + address: + $ref: "#/components/schemas/Address" + value: + $ref: "#/components/schemas/ValueAsString" + datum_hash: + $ref: "#/components/schemas/DatumHash" + datum: + description: The resolved datum, if available. The field is only and always present (yet may be `null`) if `?resolve_hashes` was set. + oneOf: + - <<: *BinaryData + description: A serialized Plutus' Data. + - type: "null" + description: None or unknown datum. + datum_type: + $ref: "#/components/schemas/DatumType" + script_hash: + $ref: "#/components/schemas/ScriptHash" + script: + description: The resolved script, if available. The field is only and always present (yet may be `null`) if `?resolve_hashes` was set. + oneOf: + - $ref: "#/components/schemas/Script" + - type: "null" + description: None or unknown script. + created_at: + <<: *Point + description: Block reference at which this transaction was included in the ledger. + spent_at: + description: Block reference at which this transaction input was spent, if any. + oneOf: + - $ref: "#/components/schemas/SpentAt" + - type: "null" + Health: type: object description: An overview of the server & connection status. Note that, when `most_recent_checkpoint` and `most_recent_node_tip` are equal, the index is fully synchronized. @@ -1325,6 +1421,8 @@ components: - connection_status - most_recent_checkpoint - most_recent_node_tip + - seconds_since_last_block + - network_synchronization - configuration - version properties: @@ -1346,6 +1444,20 @@ components: description: Absolute slot number of the current tip of the node. - type: "null" description: Absolute slot number of the current tip of the node. + seconds_since_last_block: + oneOf: + - type: integer + description: Number of seconds elapsed since the last block was ingested by Kupo. + - type: "null" + description: Number of seconds elapsed since the last block was ingested by Kupo. + network_synchronization: + oneOf: + - type: number + minimum: 0 + maximum: 1 + description: A progress percentage of the synchronization towards the node tip. + - type: "null" + description: A progress percentage of the synchronization towards the node tip. configuration: type: object description: A summary of hand-picked configuration parameters. @@ -1371,20 +1483,6 @@ components: - `connected` and `disconnected` (from `connection_status`) are encoded as `1.0` and `0.0` respectively. - `installed` and `deferred` (from `configuration.indexes`) are encoded as `1.0` and `0.0` respectively. - `version` is not present in the Prometheus metrics. - examples: - response: - value: | - # TYPE kupo_connection_status gauge - kupo_connection_status 1.0 - - # TYPE kupo_most_recent_checkpoint counter - kupo_most_recent_checkpoint 294998 - - # TYPE kupo_most_recent_node_tip counter - kupo_most_recent_node_tip 71753381 - - # TYPE kupo_configuration_indexes gauge - kupo_configuration_indexes 1.0 parameters: asset-name: @@ -1778,6 +1876,13 @@ paths: Optionally, use `?resolve_hashes` to automatically resolve and include `datum` and `script` associated with hash references, if available. Datums and scripts can otherwise be fetched using the [_Get Datum by Hash_](#tag/Datums/paths/~1datums~1{datum-hash}/get) and [_Get Script by Hash_](#tag/Scripts/paths/~1scripts~1{script-hash}/get) endpoints respectively. Note that it is generally a bad idea to fetch **ALL matches** for indexes built off permissive patterns (e.g. `*`), for the server will yield a large response. + + > TIP
+ > + > You can customize coins and assets quantities encoding to always be strings instead of integers through the + > `Accept` header media-type as such: + > + > `Accept: application/json;asset-quantity=string` parameters: - $ref: "#/components/parameters/resolve-hashes" - $ref: "#/components/parameters/spent" @@ -1801,6 +1906,11 @@ paths: type: array items: $ref: "#/components/schemas/Match" + "application/json;charset=utf-8;asset-quantity=string": + schema: + type: array + items: + $ref: "#/components/schemas/MatchQuantityAsString" 304: $ref: "#/components/responses/304" @@ -1812,6 +1922,13 @@ paths: description: | Retrieve matches from the database matching the given pattern, in descending `slot_no` order. Results are streamed to the client for more efficiency. See [Patterns](#section/Patterns) for more information about constructing patterns. + + > TIP
+ > + > You can customize coins and assets quantities encoding to always be strings instead of integers through the + > `Accept` header media-type as such: + > + > `Accept: application/json;asset-quantity=string` parameters: - $ref: "#/components/parameters/pattern" - $ref: "#/components/parameters/resolve-hashes" @@ -1836,6 +1953,11 @@ paths: type: array items: $ref: "#/components/schemas/Match" + "application/json;charset=utf-8;asset-quantity=string": + schema: + type: array + items: + $ref: "#/components/schemas/MatchQuantityAsString" 304: $ref: "#/components/responses/304" 400: @@ -2197,6 +2319,24 @@ paths: "text/plain;charset=utf-8": schema: $ref: "#/components/schemas/HealthPrometheus" + example: &HealthPrometheusExample | + # TYPE kupo_configuration_indexes gauge + kupo_configuration_indexes 1.0 + + # TYPE kupo_connection_status gauge + kupo_connection_status 1.0 + + # TYPE kupo_most_recent_checkpoint counter + kupo_most_recent_checkpoint 61264845 + + # TYPE kupo_most_recent_node_tip counter + kupo_most_recent_node_tip 82838775 + + # TYPE kupo_network_synchronization gauge + kupo_network_synchronization 0.73956 + + # TYPE kupo_seconds_since_last_block gauge + kupo_seconds_since_last_block 2.0 202: description: Syncing @@ -2207,6 +2347,7 @@ paths: $ref: "#/components/schemas/Health" "text/plain;charset=utf-8": + example: *HealthPrometheusExample schema: $ref: "#/components/schemas/HealthPrometheus" @@ -2219,5 +2360,27 @@ paths: $ref: "#/components/schemas/Health" "text/plain;charset=utf-8": + example: *HealthPrometheusExample schema: $ref: "#/components/schemas/HealthPrometheus" + + /metrics: + get: + operationId: getMetrics + tags: ["Health"] + summary: Get Metrics + description: | + Like [`/health`](#operation/getHealth), but always return `200 OK` as a status. + responses: + 200: + description: Metrics + headers: *default-headers + content: + "text/plain;charset=utf-8": + example: *HealthPrometheusExample + schema: + $ref: "#/components/schemas/HealthPrometheus" + + "application/json;charset=utf-8": + schema: + $ref: "#/components/schemas/Health" diff --git a/docs/index.html b/docs/index.html index a5ee3f27..0dc4881e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -126,8 +126,8 @@
- v2.10.0 v2.11.0 + v2.12.0 nightly