This is a slightly unusual MS-SQL Server client in that you configure your connection details & the SQL statements you want to execute inside a YAML file. Running the app will then connect to that SQL Server and execute those statements. You will then get the following data returned in CSV format:
- statement ID
- time SQL request was sent
- response time in microseconds
- number of records returned
- SQL statement
Within the YAML file you can also request to iterate through the defined SQL statements multiple times, as well as specify the concurrency (i.e. how many SQL statements to be executing simultaneously).
To run it, all you need are 2 files: the compiled Go executable and the database.yaml
file, which can be tweaked for your specific environment and use case.
This makes it a good fit for highly-specific tasks such as benchmarking response times and latency from end-user systems, which is the reason I created it in the first place. The intended use case is to run it from different PCs over different network links, and compare the latencies. This information can then be used to inform possible infrastructure upgrades.
Use one of:
$ make local
$ make windows
$ make linux
$ make mac
depending on which OS you want to compile for
Then to run it:
$ ./bin/sql-client > results.csv
...
To spin up a local MS SQL Server instance inside Docker:
$ docker pull mcr.microsoft.com/mssql/server:2019-latest
$ docker run -d --name sql_server_demo -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=reallyStrongPwd123' -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest