Code Monkey home page Code Monkey logo

jnomad's Introduction

Java Source Code Query Scanner / Index Recommendations

Build Status

JNomad is a utility for scanning Java source code bases for HQL/SQL queries which are then ran as an explain statement against a PostgreSQL/MySQL database to determine the most inefficent queries and indexes that would make them more efficent.

Download

http://www.codebrig.com/public_files/JNomad/JNomadCLI.zip

Usage

-analyze_explain           Execute query explain with analyze (will actually run query) (default: true)
-cache_scan_results        Cache scan results to jnomad.cache file (default: true)
-db_database               Database name
-db_host                   Database host (Use : to specify host (ex. localhost:5432) [default = 5432])
-db_password               Database password
-db_type                   Database type (Supported: PostgreSQL, MySQL) (default: PostgreSQL)
-db_username               Database username
-f, -log_file              Log console output to specified file
-help, --help              Displays help information (default: false)
-index_priority_threshold  Threshold index priority for recommendation (default: 50)
-offender_report_percent   Report percentage of top offenders (default: 10)
-scan_directory            Directory/directories of Java source code to be scanned for queries
-scan_file                 File(s) of Java source code to be scanned for queries
-scan_file_limit           Java source code file scan limit [-1 = disabled] (default: -1)
-scan_recursive            Scan source directory/directories recursively (default: true)
-scan_thread_count         Number of processing threads to use (default: 5)
-source_directory          Directory/directories of Java source code to be used for type solving
-source_directory_prescan  Pre-scan scan directory for available source directories (default: true)
-version, --version        Displays version information (default: false)

Examples

Example 1
  • Scan "C:\MyWorkspace\MyJavaProject"
  • Run explains against database "postgresql://localhost:5432/postgres"
java -jar JNomadCLI.jar -scan_directory C:\MyWorkspace\MyJavaProject -db_host localhost -db_username postgres -db_password postgres -db_database postgres
Example 2
  • Scan "C:\MyWorkspace\MyJavaProject"
  • Run explains against databases "postgresql://localhost:5432/postgres" & "postgresql://localhost:5432/postgres2"
java -jar JNomadCLI.jar -scan_directory C:\MyWorkspace\MyJavaProject -db_host localhost -db_username postgres -db_password postgres -db_database postgres -db_host localhost -db_username postgres -db_password postgres -db_database postgres2

Output

****************************************************************************************************
JNomad {1.5/Alpha}: Index Recommendations
****************************************************************************************************

Index: CREATE INDEX idx_column_c ON table_b (column_c);
	Index Priority: 1202.0
	Index Table: table_b
	Index Condition: column_c
	Index Affects: 
		File: src\test\resources\TestSingleFile.java - Location: (line 19,col 23)-(line 19,col 88)

jnomad's People

Contributors

bfergerson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

jnomad's Issues

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.