{"id":15436895,"url":"https://github.com/mrasu/gravityr","last_synced_at":"2025-04-19T18:32:57.767Z","repository":{"id":48851340,"uuid":"516675137","full_name":"mrasu/GravityR","owner":"mrasu","description":"Find bottleneck in your application","archived":false,"fork":false,"pushed_at":"2022-11-26T12:32:16.000Z","size":1212,"stargazers_count":48,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-18T10:27:52.546Z","etag":null,"topics":["database","hasura","jaeger","mysql","performance","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrasu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-22T08:41:27.000Z","updated_at":"2024-01-23T03:11:01.000Z","dependencies_parsed_at":"2023-01-22T10:45:48.760Z","dependency_job_id":null,"html_url":"https://github.com/mrasu/GravityR","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrasu%2FGravityR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrasu%2FGravityR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrasu%2FGravityR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrasu%2FGravityR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrasu","download_url":"https://codeload.github.com/mrasu/GravityR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249239241,"owners_count":21235822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","hasura","jaeger","mysql","performance","postgresql"],"created_at":"2024-10-01T18:53:57.004Z","updated_at":"2025-04-16T12:30:44.195Z","avatar_url":"https://github.com/mrasu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GravityR is a Gravity-Radar.  \nThis exists to reduce time to find bottleneck in your application.\nAnd also this is to solve the problems faster and easier.  \n\n# Features\n\n### Analyze application bottleneck\n\nYou can find bottleneck of application using Jaeger or AWS's PerformanceInsights\n\n![Jaeger](/docs/images/jaeger.png)\n\n### Analyze database bottleneck\n\nYou can find bottleneck of PostgreSQL, Hasura and MySQL\n\n![PostgreSQL](/docs/images/postgres.png)\n\n# Example\n\n### Dig\n\nBelow shows performance information by digging run history like traces.  \n\n* [app dig jaeger](https://mrasu.github.io/GravityR/jaeger.html)\n* [db dig performance-insights](https://mrasu.github.io/GravityR/performance-insights.html)\n\n### Suggest\n\nBelow shows how you can accelerate the query by adding index.\n\n* [db suggest mysql](https://mrasu.github.io/GravityR/mysql.html)\n* [db suggest mysql --with-examine](https://mrasu.github.io/GravityR/mysql_examine.html)\n* [db suggest postgres](https://mrasu.github.io/GravityR/postgres.html)\n* [db suggest postgres --with-examine](https://mrasu.github.io/GravityR/postgres_examine.html)\n* [db suggest hasura postgres](https://mrasu.github.io/GravityR/hasura_postgres.html)\n* [db suggest hasura postgres --with-examine](https://mrasu.github.io/GravityR/hasura_postgres_examine.html)\n\n# Usage\n\n1. Download the latest binary from [releases](https://github.com/mrasu/GravityR/releases) page\n2. Give execution permission and rename to `gr`\n    ```sh\n    chmod u+x gr_xxx\n    mv gr_xxx gr\n    ```\n3. Run commands to find bottlenecks!  \n    examples:\n    ```sh\n    # Set envs to connect DB and Hasura\n    export DB_USERNAME=root DB_DATABASE=gravityr\n    export HASURA_URL=\"http://localhost:8081\" HASURA_ADMIN_SECRET=\"myadminsecretkey\" \n    export JAEGER_UI_URL=\"http://localhost:16686\" JAEGER_GRPC_ADDRESS=\"localhost:16685\"\n    \n    # Get database information with AWS' Performance Insights\n    gr db dig performance-insights -o \"example/performance-insights.html\"\n    \n    # Search your MySQL's SQL with EXPLAIN\n    gr db suggest mysql -o \"example/mysql.html\" -q \"SELECT name, t.description FROM users INNER JOIN tasks AS t ON users.id = t.user_id WHERE users.name = 'foo'\"\n    \n    # Search your MySQL's SQL by adding indexes temporarily\n    gr db suggest mysql --with-examine -o \"example/mysql_examine.html\" -q \"SELECT name, t.description FROM users INNER JOIN tasks AS t ON users.id = t.user_id WHERE users.name = 'foo'\"\n    \n    # Search your PostgreSQL's SQL with EXPLAIN\n    gr db suggest postgres -o \"example/postgres.html\" -q \"SELECT name, t.description FROM users INNER JOIN tasks AS t ON users.id = t.user_id WHERE users.name = 'foo'\"\n    \n    # Search your PostgreSQL's SQL by adding indexes temporarily\n    gr db suggest postgres --with-examine -o \"example/postgres_examine.html\" -q \"SELECT name, t.description FROM users INNER JOIN tasks AS t ON users.id = t.user_id WHERE users.name = 'foo'\"\n    \n    # Search your Hasura's GraphQL with EXPLAIN\n    gr db suggest hasura postgres -o \"example/hasura.html\" -q \"query MyQuery(\\$email: String) {\n      tasks(where: {user: {email: {_eq: \\$email}}}) {\n        user {\n          name\n        }\n        description\n      }\n    }\n    \" --json-variables '{\"email\": \"test1112@example.com\"}'\n    \n    # Search your Hasura's GraphQL by adding indexes temporarily\n    gr db suggest hasura postgres --with-examine -o \"example/hasura_examine.html\" -q \"query MyQuery(\\$email: String) {\n      tasks(where: {user: {email: {_eq: \\$email}}}) {\n        user {\n          name\n        }\n        description\n      }\n    }\n    \" --json-variables '{\"email\": \"test1112@example.com\"}'\n   \n    # Get application information with Jaeger\n    gr app dig jaeger -o \"example/jaeger.html\" --service-name bff\n    ```\n\n# Environment Variables\n\n| Command                    | Key                 | Description                                      |\n|----------------------------|---------------------|--------------------------------------------------|\n| db suggest hasura postgres | HASURA_URL          | URL to hasura. (e.g. http://localhost:8081)      |\n|                            | HASURA_ADMIN_SECRET | Token to connect as admin                        |\n| db suggest mysql           | DB_USERNAME         | User of mysql                                    |\n|                            | DB_PASSWORD         | Password of mysql                                |\n|                            | DB_PROTOCOL         | Protocol to connect mysql. `tcp` by default      |\n|                            | DB_ADDRESS          | Network address of mysql                         |\n|                            | DB_DATABASE         | Database name of mysql                           |\n|                            | DB_PARAM_TEXT       | Arbitrary text used after `?` in DSN             |\n| db suggest postgres        | DB_USERNAME         | User of PostgreSQL                               |\n|                            | DB_PASSWORD         | Password of PostgreSQL                           |\n|                            | DB_HOST             | Host of PostgreSQL                               |\n|                            | DB_PORT             | Port of PostgreSQL                               |\n|                            | DB_DATABASE         | Database name of PostgreSQL                      |\n|                            | DB_SEARCH_PATH      | Search path of PostgreSQL. `public` by default   |\n|                            | DB_PARAM_TEXT       | Arbitrary text for connection string             |\n| app dig jaeger             | JAEGER_UI_URL       | URL to Jaeger's UI (e.g. http://localhost:16686) |\n|                            | JAEGER_GRPC_ADDRESS | Address to GRPC's query server                   |\n\n# Build\n```sh\n$ cd client \u0026\u0026 yarn\n$ make build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrasu%2Fgravityr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrasu%2Fgravityr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrasu%2Fgravityr/lists"}