Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Sql Tracer

A small tool to know how fast your database responds.

Settings

namesample valuedescription
-aseus_01an alias of the server
-h10.10.20.30database host like localhost, 127.0.0.1, an ip, etc
-p1521database port: 1521 for oracle, 3306 for mysql, etc
-urootdatabase connection user
-nemployee_dbdatabase name. For oracle set the service name
-r/tmp/database_connection_report.csva location to the desired csv report
-i15value in seconds to be used a interval of execution

The password is a special and sensible value, so we cannot set it directly. You will

For linux/mac

export sql_tracer_database_password=admin123

And for windows you can use the Environment Variable Manager

Usage

  • Dowload the latest release from here
  • Configure the password as was explained previously
  • Open a shell and run this

Linux/Mac

./sql_tracer -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r /tmp/database_connection_report.csv -i 5

Windows

sql_tracer.exe -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r C:\\Users\\Jane\\Desktop\\database_connection_report.csv -i 5

Report

  • client ip
  • client alias
  • ping start datetime
  • ping end datetime
  • status (success or error)
  • elapsed time in millis
  • error summary (one line)

All the metrics will be stored in the provided report location. Example:

Requirements

Dependencies

go get github.com/sijms/go-ora/v2

Run for developers

Set the database password as was explained.

Then execute for Linux/Mac

go run src/main/go/sql_tracer.go -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r /tmp/database_connection_report.csv -i 5

And for windows

go run src/main/go/sql_tracer.go -a seus_01 -p 1521 -h 10.10.20.30 -u system -n xe -r C:\\Users\\Jane\\Desktop\\database_connection_report.csv -i 5

Build

Linux/Mac

go build -o build/sql_tracer src/main/go/sql_tracer.go

Windows

env GOOS=windows GOARCH=amd64 go build -o build/sql_tracer.exe src/main/go/sql_tracer.go

If no errors, you will find the executable in the build folder. Then you could use it in a machine without go

Error codes

codedescription
6660I was not able to enter to that catch :/
6661usually bad host or credentials
6662Connected but query validation got an error
66650report exist but cannot be accesed to append it

Advanced settings

For notitifations, templates, plugins, etc go to the wiki

Acknowledgments

Contributors


JRichardsz

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages