Git Product home page Git Product logo

gravityr's Introduction

GravityR is a Gravity-Radar.
This exists to reduce time to find bottleneck in your application. And also this is to solve the problems faster and easier.

Features

Analyze application bottleneck

You can find bottleneck of application using Jaeger or AWS's PerformanceInsights

Jaeger

Analyze database bottleneck

You can find bottleneck of PostgreSQL, Hasura and MySQL

PostgreSQL

Example

Dig

Below shows performance information by digging run history like traces.

Suggest

Below shows how you can accelerate the query by adding index.

Usage

  1. Download the latest binary from releases page
  2. Give execution permission and rename to gr
    chmod u+x gr_xxx
    mv gr_xxx gr
  3. Run commands to find bottlenecks!
    examples:
    # Set envs to connect DB and Hasura
    export DB_USERNAME=root DB_DATABASE=gravityr
    export HASURA_URL="http://localhost:8081" HASURA_ADMIN_SECRET="myadminsecretkey" 
    export JAEGER_UI_URL="http://localhost:16686" JAEGER_GRPC_ADDRESS="localhost:16685"
    
    # Get database information with AWS' Performance Insights
    gr db dig performance-insights -o "example/performance-insights.html"
    
    # Search your MySQL's SQL with EXPLAIN
    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'"
    
    # Search your MySQL's SQL by adding indexes temporarily
    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'"
    
    # Search your PostgreSQL's SQL with EXPLAIN
    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'"
    
    # Search your PostgreSQL's SQL by adding indexes temporarily
    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'"
    
    # Search your Hasura's GraphQL with EXPLAIN
    gr db suggest hasura postgres -o "example/hasura.html" -q "query MyQuery(\$email: String) {
      tasks(where: {user: {email: {_eq: \$email}}}) {
        user {
          name
        }
        description
      }
    }
    " --json-variables '{"email": "[email protected]"}'
    
    # Search your Hasura's GraphQL by adding indexes temporarily
    gr db suggest hasura postgres --with-examine -o "example/hasura_examine.html" -q "query MyQuery(\$email: String) {
      tasks(where: {user: {email: {_eq: \$email}}}) {
        user {
          name
        }
        description
      }
    }
    " --json-variables '{"email": "[email protected]"}'
    
    # Get application information with Jaeger
    gr app dig jaeger -o "example/jaeger.html" --service-name bff

Environment Variables

Command Key Description
db suggest hasura postgres HASURA_URL URL to hasura. (e.g. http://localhost:8081)
HASURA_ADMIN_SECRET Token to connect as admin
db suggest mysql DB_USERNAME User of mysql
DB_PASSWORD Password of mysql
DB_PROTOCOL Protocol to connect mysql. tcp by default
DB_ADDRESS Network address of mysql
DB_DATABASE Database name of mysql
DB_PARAM_TEXT Arbitrary text used after ? in DSN
db suggest postgres DB_USERNAME User of PostgreSQL
DB_PASSWORD Password of PostgreSQL
DB_HOST Host of PostgreSQL
DB_PORT Port of PostgreSQL
DB_DATABASE Database name of PostgreSQL
DB_SEARCH_PATH Search path of PostgreSQL. public by default
DB_PARAM_TEXT Arbitrary text for connection string
app dig jaeger JAEGER_UI_URL URL to Jaeger's UI (e.g. http://localhost:16686)
JAEGER_GRPC_ADDRESS Address to GRPC's query server

Build

$ cd client && yarn
$ make build

gravityr's People

Contributors

mrasu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nakamotojp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.