Skip to content

BE-426: Merge graph test-server into admin endpoint in main binary#8497

Open
TimDiekmann wants to merge 4 commits intot/be-311-implement-deletion-for-entitiesfrom
t/be-426-merge-graph-test-server-into-main-binary-as-admin-endpoint
Open

BE-426: Merge graph test-server into admin endpoint in main binary#8497
TimDiekmann wants to merge 4 commits intot/be-311-implement-deletion-for-entitiesfrom
t/be-426-merge-graph-test-server-into-main-binary-as-admin-endpoint

Conversation

@TimDiekmann
Copy link
Member

@TimDiekmann TimDiekmann commented Mar 2, 2026

🌟 What is the purpose of this PR?

Removes the standalone hash-graph-test-server crate and merges its functionality into the main hash-graph binary as an admin endpoint. Introduces a robust server lifecycle system with crash detection, graceful shutdown cascading, and non-zero exit codes.

🚫 Blocked by

🔍 What does this change?

Admin endpoint migration:

  • Deletes libs/@local/graph/test-server crate entirely
  • Adds libs/@local/graph/api/src/rest/admin.rs with routes: /health, POST /snapshot, DELETE /accounts, DELETE /data-types, DELETE /property-types, DELETE /entity-types, POST /entities/delete
  • Adds admin-server subcommand for standalone operation
  • Adds --embed-admin flag to server subcommand for dev convenience
  • Adds --embed-type-fetcher flag to server subcommand (replaces running type-fetcher separately)
  • Updates .env, CI workflows, and Docker build to remove test-server references

Server lifecycle overhaul (ServerTaskTrackerServerLifecycle):

  • Shared shutdown + abort CancellationTokens for coordinated shutdown
  • ShutdownGuard (Drop-based) detects unexpected task exits including panics
  • select! over ctrl-c/abort in all entrypoints — crash in any component cascades shutdown
  • Double ctrl-c for force shutdown (process::exit(1))
  • Non-zero exit code when a server component crashes

Bug fixes:

  • Bind TcpListener before logging "Listening on" (was logging before bind could fail)
  • Admin route HttpTracingLayer placed after routes (was wrapping empty router)
  • delete_entities deserialization error now returns 422 instead of 500
  • Deduplicate TemporalClient Arc wrapping (was created twice for REST + RPC)
  • install_error_stack_hook moved to run in both embedded and standalone paths

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

⚠️ Known issues

  • The --embed-admin and --embed-type-fetcher flags use fire-and-forget spawning without startup healthchecks. Startup failures are caught by the abort mechanism (non-zero exit) but the REST server may start before embedded services are ready. In practice this is fine since connections are on-demand.

🐾 Next steps

  • Consider propagating the actual error report (not just non-zero exit) from crashed tasks back to main
  • Steady-state healthchecks for production (ECS handles this via task health checks)

🛡 What tests cover this?

  • Existing integration tests in tests/hash-backend-integration updated to use admin endpoint
  • tests/graph/http/tests/reset-database.http updated for new admin port

❓ How to test this?

  1. cargo clippy --package hash-graph --all-features — should be clean
  2. cargo run --bin hash-graph --all-features -- server --embed-admin --embed-type-fetcher — all three servers start
  3. curl http://127.0.0.1:4001/health — admin endpoint responds
  4. Ctrl-c — graceful shutdown of all components
  5. Ctrl-c twice quickly — force exit

Replace the standalone `hash-graph-test-server` crate with an admin API
served from the main `hash-graph` binary. The admin server can run as a
dedicated `admin-server` subcommand or be embedded into the main
`server` subcommand via `--embed-admin`.

- Add `admin.rs` REST routes in `hash-graph-api` (snapshot restore,
  delete accounts/types/entities)
- Add `admin-server` subcommand with standalone healthcheck support
- Add `--embed-admin` and `--embed-type-fetcher` flags to `server`
- Refactor type-fetcher into the same standalone/embeddable pattern
- Remove `hash-graph-test-server` crate, feature flag, and Docker
  build arg
- Replace `DELETE /entities` with `POST /entities/delete` using the
  new `DeleteEntitiesParams` API
- Remove `delete_all_entities` from postgres store
- Fix `HttpTracingLayer` ordering so it actually wraps admin routes
- Move `install_error_stack_hook` into `run_admin_server` so both
  standalone and embedded paths get it
- Update all TS integration tests to use `admin-server` imports
- Update `.env` defaults for embedded dev workflow
…tdown

Introduces a shared lifecycle coordinator with shutdown/abort
CancellationTokens and a ShutdownGuard that detects unexpected task exits
(including panics). All server subcommands now use select! over ctrl-c and
abort, return non-zero exit codes on crash, and support double ctrl-c for
force shutdown.

Also fixes: bind-before-log ordering in REST/admin servers, layer ordering
in admin routes, deserialization errors returning 500 instead of 422, and
deduplicates TemporalClient Arc wrapping.
@TimDiekmann TimDiekmann requested a review from a team as a code owner March 2, 2026 20:41
@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated (UTC)
hash Ignored Ignored Preview Mar 3, 2026 0:46am
hashdotdesign Ignored Ignored Preview Mar 3, 2026 0:46am
hashdotdesign-tokens Ignored Ignored Preview Mar 3, 2026 0:46am
petrinaut Skipped Skipped Comment Mar 3, 2026 0:46am

@cursor
Copy link

cursor bot commented Mar 2, 2026

PR Summary

High Risk
Introduces a new admin HTTP surface with destructive database operations (snapshot restore and bulk deletes) and refactors server startup/shutdown across REST/RPC/type-fetcher, increasing risk of misconfiguration or accidental data loss if the admin port is exposed.

Overview
Replaces the removed hash-graph-test-server crate and test-server subcommand with a new admin REST API (rest::admin) served via a standalone admin-server subcommand or embedded into server via --embed-admin, including snapshot restore and bulk-delete endpoints (plus filtered POST /entities/delete).

Refactors the server and type-fetcher entrypoints around a shared ServerLifecycle (shutdown/abort tokens + task tracking), adds --embed-type-fetcher, deduplicates TemporalClient sharing via Arc, and tightens healthchecks/error handling (e.g., error_for_status).

Updates Docker/CI/env config to drop ENABLE_TEST_SERVER and test-server ports, and removes associated workspace/package references and generated dependency diagrams.

Written by Cursor Bugbot for commit baf6251. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/tests > integration New or updated integration tests area/apps area/apps > hash-graph type/legal Owned by the @legal team labels Mar 2, 2026
Copy link
Member Author

TimDiekmann commented Mar 2, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 0% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.75%. Comparing base (46a1015) to head (baf6251).

Files with missing lines Patch % Lines
libs/@local/graph/api/src/rest/admin.rs 0.00% 110 Missing ⚠️
libs/@local/graph/api/src/rest/mod.rs 0.00% 1 Missing ⚠️
libs/@local/graph/api/src/rpc/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##           t/be-311-implement-deletion-for-entities    #8497      +/-   ##
============================================================================
- Coverage                                     62.80%   62.75%   -0.06%     
============================================================================
  Files                                          1303     1304       +1     
  Lines                                        133446   133554     +108     
  Branches                                       5509     5509              
============================================================================
- Hits                                          83811    83809       -2     
- Misses                                        48721    48831     +110     
  Partials                                        914      914              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.40% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
rust.harpc-tower 66.80% <ø> (ø)
rust.hash-graph-temporal-versioning 47.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 2, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing t/be-426-merge-graph-test-server-into-main-binary-as-admin-endpoint (baf6251) with t/be-311-implement-deletion-for-entities (46a1015)

Open in CodSpeed

@augmentcode
Copy link

augmentcode bot commented Mar 2, 2026

🤖 Augment PR Summary

Summary: This PR removes the standalone hash-graph-test-server crate and merges its functionality into the main hash-graph binary as a dedicated admin API.

Changes:

  • Adds a new REST admin router (libs/@local/graph/api/src/rest/admin.rs) with /health, snapshot restore, ontology cleanup, and entity deletion endpoints
  • Introduces an admin-server subcommand and an optional server --embed-admin mode for dev
  • Adds --embed-type-fetcher to run the type fetcher alongside the main server and updates env defaults accordingly
  • Refactors process/task management from a task tracker to ServerLifecycle with shared shutdown/abort tokens and crash detection
  • Unifies Temporal client sharing via Arc across REST/RPC dependencies to avoid duplicate wrapping

Technical Notes: Entry points now use tokio::select! to cascade shutdown on component failure and support “double Ctrl+C” forced exit; integration tests and reset scripts are updated to call the new admin endpoints.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

- Add error_for_status() to healthcheck endpoints (admin + server)
- Remove unnecessary shutdown.clone() in ServerLifecycle::spawn
- Remove dead FEATURES array from Dockerfile
- Remove @rust/hash-graph-type-fetcher from root start script
- Add @apps/hash-graph as benchmark dependency so turbo starts the
  graph server (with embedded type-fetcher) before running benchmarks
- Delete turbo.json overrides that were suppressing default dependencies
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

The admin-server and type-fetcher subcommands now match the server
subcommand's behavior: a second ctrl-c during graceful shutdown
triggers process::exit(1) to prevent hanging on stuck tasks.
@vercel vercel bot temporarily deployed to Preview – petrinaut March 3, 2026 00:46 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$28.3 \mathrm{ms} \pm 209 \mathrm{μs}\left({\color{gray}2.10 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.50 \mathrm{ms} \pm 13.6 \mathrm{μs}\left({\color{gray}-0.037 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.6 \mathrm{ms} \pm 82.6 \mathrm{μs}\left({\color{gray}-0.404 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.9 \mathrm{ms} \pm 274 \mathrm{μs}\left({\color{gray}0.079 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.0 \mathrm{ms} \pm 102 \mathrm{μs}\left({\color{gray}-0.642 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$24.9 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}1.79 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.8 \mathrm{ms} \pm 179 \mathrm{μs}\left({\color{gray}-0.783 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.85 \mathrm{ms} \pm 27.2 \mathrm{μs}\left({\color{gray}0.746 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.6 \mathrm{ms} \pm 100.0 \mathrm{μs}\left({\color{gray}-0.592 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.90 \mathrm{ms} \pm 16.8 \mathrm{μs}\left({\color{gray}-0.228 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.10 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}0.545 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.48 \mathrm{ms} \pm 19.2 \mathrm{μs}\left({\color{gray}0.452 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.35 \mathrm{ms} \pm 38.8 \mathrm{μs}\left({\color{gray}0.073 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.67 \mathrm{ms} \pm 19.6 \mathrm{μs}\left({\color{gray}-0.860 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.29 \mathrm{ms} \pm 30.1 \mathrm{μs}\left({\color{gray}0.861 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.63 \mathrm{ms} \pm 37.2 \mathrm{μs}\left({\color{gray}1.24 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.57 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}0.851 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.21 \mathrm{ms} \pm 26.1 \mathrm{μs}\left({\color{gray}0.212 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.82 \mathrm{ms} \pm 12.1 \mathrm{μs}\left({\color{gray}0.458 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.80 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{gray}0.902 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.92 \mathrm{ms} \pm 18.6 \mathrm{μs}\left({\color{gray}1.31 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.15 \mathrm{ms} \pm 12.3 \mathrm{μs}\left({\color{gray}-0.642 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.96 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}-0.626 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.26 \mathrm{ms} \pm 14.4 \mathrm{μs}\left({\color{gray}-0.101 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.17 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}-0.411 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.88 \mathrm{ms} \pm 13.6 \mathrm{μs}\left({\color{gray}-2.712 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$3.04 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}-0.928 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.60 \mathrm{ms} \pm 17.1 \mathrm{μs}\left({\color{gray}-0.892 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.15 \mathrm{ms} \pm 16.3 \mathrm{μs}\left({\color{gray}-1.016 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.40 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}-0.483 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.57 \mathrm{ms} \pm 20.2 \mathrm{μs}\left({\color{gray}-0.151 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.15 \mathrm{ms} \pm 15.4 \mathrm{μs}\left({\color{gray}-0.919 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.42 \mathrm{ms} \pm 19.0 \mathrm{μs}\left({\color{gray}-0.935 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$41.4 \mathrm{ms} \pm 199 \mathrm{μs}\left({\color{gray}-0.698 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$79.4 \mathrm{ms} \pm 370 \mathrm{μs}\left({\color{gray}2.22 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$45.5 \mathrm{ms} \pm 243 \mathrm{μs}\left({\color{gray}-2.458 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$48.9 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{gray}0.637 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$56.1 \mathrm{ms} \pm 273 \mathrm{μs}\left({\color{gray}0.267 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$42.6 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{gray}-1.398 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$423 \mathrm{ms} \pm 1.34 \mathrm{ms}\left({\color{gray}1.34 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$97.9 \mathrm{ms} \pm 497 \mathrm{μs}\left({\color{gray}-1.041 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$87.8 \mathrm{ms} \pm 385 \mathrm{μs}\left({\color{gray}0.511 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$287 \mathrm{ms} \pm 854 \mathrm{μs}\left({\color{gray}0.261 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$15.7 \mathrm{ms} \pm 77.9 \mathrm{μs}\left({\color{gray}0.589 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$15.9 \mathrm{ms} \pm 76.9 \mathrm{μs}\left({\color{gray}-0.374 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$16.2 \mathrm{ms} \pm 89.6 \mathrm{μs}\left({\color{gray}1.32 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$15.8 \mathrm{ms} \pm 87.8 \mathrm{μs}\left({\color{gray}0.766 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$18.9 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{gray}0.887 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$15.9 \mathrm{ms} \pm 101 \mathrm{μs}\left({\color{gray}0.228 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$15.8 \mathrm{ms} \pm 92.0 \mathrm{μs}\left({\color{gray}0.704 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$15.7 \mathrm{ms} \pm 90.1 \mathrm{μs}\left({\color{gray}0.759 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$16.4 \mathrm{ms} \pm 113 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$24.0 \mathrm{ms} \pm 193 \mathrm{μs}\left({\color{gray}2.87 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$30.7 \mathrm{ms} \pm 299 \mathrm{μs}\left({\color{gray}-2.664 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$30.9 \mathrm{ms} \pm 287 \mathrm{μs}\left({\color{gray}-2.357 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$30.8 \mathrm{ms} \pm 254 \mathrm{μs}\left({\color{gray}-4.105 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$30.5 \mathrm{ms} \pm 227 \mathrm{μs}\left({\color{gray}-0.385 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$30.9 \mathrm{ms} \pm 313 \mathrm{μs}\left({\color{gray}-0.243 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$30.7 \mathrm{ms} \pm 325 \mathrm{μs}\left({\color{gray}-2.963 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$32.2 \mathrm{ms} \pm 313 \mathrm{μs}\left({\color{gray}2.68 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$32.2 \mathrm{ms} \pm 261 \mathrm{μs}\left({\color{gray}4.39 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$31.1 \mathrm{ms} \pm 262 \mathrm{μs}\left({\color{gray}0.665 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$8.65 \mathrm{ms} \pm 45.6 \mathrm{μs}\left({\color{gray}0.082 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$90.6 \mathrm{ms} \pm 527 \mathrm{μs}\left({\color{gray}1.76 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$143 \mathrm{ms} \pm 635 \mathrm{μs}\left({\color{gray}-0.135 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$97.0 \mathrm{ms} \pm 392 \mathrm{μs}\left({\color{gray}0.045 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$107 \mathrm{ms} \pm 487 \mathrm{μs}\left({\color{gray}1.77 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$115 \mathrm{ms} \pm 428 \mathrm{μs}\left({\color{gray}0.262 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$123 \mathrm{ms} \pm 916 \mathrm{μs}\left({\color{gray}1.05 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$89.2 \mathrm{ms} \pm 337 \mathrm{μs}\left({\color{gray}-0.211 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$118 \mathrm{ms} \pm 561 \mathrm{μs}\left({\color{gray}0.875 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$96.2 \mathrm{ms} \pm 402 \mathrm{μs}\left({\color{gray}0.731 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$104 \mathrm{ms} \pm 386 \mathrm{μs}\left({\color{gray}-0.069 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$107 \mathrm{ms} \pm 370 \mathrm{μs}\left({\color{gray}0.614 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$107 \mathrm{ms} \pm 435 \mathrm{μs}\left({\color{gray}0.872 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$127 \mathrm{ms} \pm 451 \mathrm{μs}\left({\color{gray}-4.663 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$129 \mathrm{ms} \pm 427 \mathrm{μs}\left({\color{gray}-2.337 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$106 \mathrm{ms} \pm 539 \mathrm{μs}\left({\color{red}137 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$601 \mathrm{ms} \pm 3.63 \mathrm{ms}\left({\color{red}7.25 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-graph area/apps area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests > integration New or updated integration tests area/tests New or updated tests type/eng > backend Owned by the @backend team type/legal Owned by the @legal team

Development

Successfully merging this pull request may close these issues.

1 participant