Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nounder/240620-daimo-perf
https://github.com/nounder/240620-daimo-perf
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nounder/240620-daimo-perf
- Owner: nounder
- Created: 2024-06-20T20:21:22.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-06-24T23:51:51.000Z (5 months ago)
- Last Synced: 2024-08-27T01:42:13.383Z (3 months ago)
- Language: JavaScript
- Size: 37.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Measure latencies for Shovel indexing a new block and Daimo API pushing an update
via TRPC `onAccountUpdate` subscription. Treat new block notification as baseline.To trace TRPC, ensure that the server sends update on every block in `onAccountUpdate`,
and not only when there are new transfers for a user.# Environment
- Daimo API server running on the same machine.
- RPC Provider same as one used on staging Daimo and in the same geo region (<5ms latency)
- Postgres database running in different datacenter but in close geo proximity (~20ms laty)# Collect data
Run those commands in parallel
```
deno run -A --unsafely-ignore-certificate-errors rpc.js > data/rpc.tsvdeno run -A api.ts > data/api.tsv
deno run -A --unsafely-ignore-certificate-errors pg.js > data/pg.tsv
```# Analyze data
```
$ duckdb < latencies.sql┌───────────────────┬────────────────┬────────────────┬───────────────────────┐
│ avg(pg_notify) │ min(pg_notify) │ max(pg_notify) │ stddev_pop(pg_notify) │
│ double │ int64 │ int64 │ double │
├───────────────────┼────────────────┼────────────────┼───────────────────────┤
│ 568.5408163265306 │ 43 │ 1911 │ 312.72620118157045 │
└───────────────────┴────────────────┴────────────────┴───────────────────────┘
┌───────────────────┬────────────────┬────────────────┬───────────────────────┐
│ avg(trpc_emit) │ min(trpc_emit) │ max(trpc_emit) │ stddev_pop(trpc_emit) │
│ double │ int64 │ int64 │ double │
├───────────────────┼────────────────┼────────────────┼───────────────────────┤
│ 4189.658291457286 │ 2026 │ 5597 │ 891.1819624916385 │
└───────────────────┴────────────────┴────────────────┴───────────────────────┘
```