Skip to content
New issue

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

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

Already on GitHub? # to your account

Make graphman query more usable #3860

Merged
merged 3 commits into from
Aug 22, 2022
Merged

Make graphman query more usable #3860

merged 3 commits into from
Aug 22, 2022

Conversation

lutter
Copy link
Collaborator

@lutter lutter commented Aug 19, 2022

I was using graphman query to look at performance for some queries and got very annoyed with the amount of log spam it produces. This PR changes the following:

  • the query result now goes into a file given with --output
  • the query trace can be saved in a file given with --trace (the file format is sorta janky, but good enough to fish out individual SQL queries)
  • the command output is now actually readable
  • you still need to turn on logging by setting GRAPH_LOG_QUERY_TIMING=gql,sql; untangling that is surprisingly complicated

Example of using it:

> GRAPH_LOG_QUERY_TIMING=gql,sql  graphman query "<deployment>" "<query>"

 root                                                2759ms
  liquidityPools                                       404ms [     50 entities]
    fees                                               202ms [    150 entities]
    inputTokens                                        609ms [    100 entities]
    rewardTokens                                       190ms [     31 entities]
      token                                            191ms [      1 entities]

query:         1598ms
other:         1160ms
total:         2759ms

@lutter lutter merged commit 308df0d into master Aug 22, 2022
@lutter lutter deleted the lutter/query branch August 22, 2022 15:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants