Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc benchmark: script to pull Grafana logs #20911

Open
wants to merge 4 commits into
base: rpc-benchmark-init
Choose a base branch
from

Conversation

gegaowp
Copy link
Contributor

@gegaowp gegaowp commented Jan 17, 2025

Description

a stacked pr, pull sampled JSON RPC request logs from Grafana API, now a local port-forward is necessary to make it work

Test plan

local run

  • on one CLI (some pre-requisite gcloud setup is needed)
k -n loki port-forward loki-loki-distributed-querier-11 3100:3100
  • the other CLI, with limit for faster test run
RUST_LOG=debug GRAFANA_LOGS_URL="http://localhost:3100/loki/api/v1/query_range" NET="mainnet" LIMIT=1000 cargo run --bin pull_grafana_logs

the output, suix_getBalance / suix_getAllBalances are the top ones taking the majority

2025-01-24T06:29:42.818121Z  INFO pull_grafana_logs: Found 1000 logs.
2025-01-24T06:29:42.836915Z  INFO pull_grafana_logs: Writing 1 logs for method: sui_getLatestCheckpointSequenceNumber
2025-01-24T06:29:42.836962Z  INFO pull_grafana_logs: Writing 1 logs for method: suix_queryTransactionBlocks
2025-01-24T06:29:42.836968Z  INFO pull_grafana_logs: Writing 12 logs for method: suix_getCoinMetadata
2025-01-24T06:29:42.836981Z  INFO pull_grafana_logs: Writing 10 logs for method: sui_getTransactionBlock
2025-01-24T06:29:42.836992Z  INFO pull_grafana_logs: Writing 41 logs for method: sui_getObject
2025-01-24T06:29:42.837037Z  INFO pull_grafana_logs: Writing 9 logs for method: suix_getCoins
2025-01-24T06:29:42.837047Z  INFO pull_grafana_logs: Writing 44 logs for method: suix_getReferenceGasPrice
2025-01-24T06:29:42.837074Z  INFO pull_grafana_logs: Writing 12 logs for method: suix_getOwnedObjects
2025-01-24T06:29:42.837096Z  INFO pull_grafana_logs: Writing 186 logs for method: suix_getAllBalances
2025-01-24T06:29:42.837186Z  INFO pull_grafana_logs: Writing 1 logs for method: sui_multiGetTransactionBlocks
2025-01-24T06:29:42.837193Z  INFO pull_grafana_logs: Writing 559 logs for method: suix_getBalance
2025-01-24T06:29:42.837424Z  INFO pull_grafana_logs: Writing 5 logs for method: suix_getStakes
2025-01-24T06:29:42.837435Z  INFO pull_grafana_logs: Writing 1 logs for method: suix_getValidatorsApy
2025-01-24T06:29:42.837440Z  INFO pull_grafana_logs: Writing 4 logs for method: suix_queryEvents
2025-01-24T06:29:42.837446Z  INFO pull_grafana_logs: Writing 1 logs for method: suix_getDynamicFieldObject
2025-01-24T06:29:42.837451Z  INFO pull_grafana_logs: Writing 13 logs for method: sui_getNormalizedMoveFunction
2025-01-24T06:29:42.837467Z  INFO pull_grafana_logs: Writing 7 logs for method: suix_resolveNameServiceNames
2025-01-24T06:29:42.837476Z  INFO pull_grafana_logs: Writing 2 logs for method: suix_getLatestSuiSystemState
2025-01-24T06:29:42.837481Z  INFO pull_grafana_logs: Writing 20 logs for method: sui_multiGetObjects
2025-01-24T06:29:42.837509Z  INFO pull_grafana_logs: Writing 8 logs for method: sui_getProtocolConfig
2025-01-24T06:29:42.837517Z  INFO pull_grafana_logs: Writing 57 logs for method: sui_dryRunTransactionBlock
2025-01-24T06:29:42.837608Z  INFO pull_grafana_logs: Done! Wrote grouped logs to sampled_read_requests.jsonl

logged jsonl file is like

{"method":"sui_getLatestCheckpointSequenceNumber", "body":{"jsonrpc": "2.0", "id": 1, "method": "sui_getLatestCheckpointSequenceNumber", "params": []}}
{"method":"suix_queryTransactionBlocks", "body":{"jsonrpc":"2.0","id":103,"method":"suix_queryTransactionBlocks","params":[{"filter":{"FromAddress":"0x231ea89eff93a0a49644d80a2a90edb08b86d191188ca886a2e901df098dee00"},"options":{"showInput":true,"showEffects":true,"showEvents":true}},null,null,true]}}
...

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Jan 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 6:36am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 6:36am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 6:36am

@gegaowp gegaowp temporarily deployed to sui-typescript-aws-kms-test-env January 17, 2025 09:08 — with GitHub Actions Inactive
@gegaowp gegaowp temporarily deployed to sui-typescript-aws-kms-test-env January 24, 2025 06:35 — with GitHub Actions Inactive
@gegaowp gegaowp changed the title Grafana pull rpc benchmark: pull Grafana logs Jan 24, 2025
@gegaowp gegaowp marked this pull request as ready for review January 24, 2025 06:41
@gegaowp gegaowp temporarily deployed to sui-typescript-aws-kms-test-env January 24, 2025 06:41 — with GitHub Actions Inactive
@gegaowp gegaowp changed the title rpc benchmark: pull Grafana logs rpc benchmark: script to pull Grafana logs Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant