Benchmark JFrog CLI plugin - upload/download speedometer
Author: Tamir David
The benchmark plugin can be found in the official plugin repository at https://github.com/tamirdavid/benchmark
If you're deploying and resolving binaries on the JFrog platform, it's likely that you want to do so as quickly as possible.
With the "benchmark" JFrog CLI plugin, you can measure the upload and download speeds of your instance, as well as compare the behavior of your Artifactory instance before and after a change such as a version upgrade or configuration change. This allows you to better understand the impact of such changes on your services.
The benchmark CLI outputs its results to a csv formatted file, which you can save for auditing purposes. You can also append new CLI results to a unified csv and track changes over time.
What is JFrog CLI PluginJFrog CLI has been extended to include JFrog CLI Plugins, which are small applications that can be installed to add new commands to JFrog CLI.
How does it work? To install the most recent version:
$ jf plugin install benchmark
Installing a specific version:
$ jf plugin install benchmark@version
Uninstalling a plugin
$ jf plugin uninstall benchmark
It is possible to run benchmark as a standalone binary:Clone the source code:
git pull https://github.com/tamirdavid/benchmark.git
Build the benchmark binary:
go build -o benchmark
To build the benchmark binary for multiple operating systems and architectures (Mac, Linux, and Windows):
./build-binary.sh
CLI ConfigurationConfigure Artifactory credentials using jf c commandAdd a new server using:
1.
$ jf c add
2. Add the Artifactory URL and authentication details.
Configure Artifactory credentials without using jf c
The CLI support specifying the instance URL and credentials explicitly
$ jf benchmark up/dl --url <myserverurl> --username <username> --password <password> <REST OF THE COMMAND>
Usage and output exampleExample of usage:
$ jf benchmark up --size 50 --iterations 10
The output will be printed to the terminal as well as written in a csv file, the URL will be logged in the plugin output.
Output Example:
file,size (MB),time taken (sec),speed (MB/sec) /tmp/testfiles/File1.txt,50,14.664069103s,3.41 /tmp/testfiles/File2.txt,50,15.302840585s,3.27 /tmp/testfiles/File3.txt,50,17.859408288s,2.80 /tmp/testfiles/File4.txt,50,14.003771159s,3.57 /tmp/testfiles/File5.txt,50,14.498499084s,3.45 /tmp/testfiles/File6.txt,50,14.844652081s,3.37 /tmp/testfiles/File7.txt,50,14.286648744s,3.50 /tmp/testfiles/File8.txt,50,14.35213191s,3.48 /tmp/testfiles/File9.txt,50,14.667853445s,3.41 /tmp/testfiles/File10.txt,50,14.682988659s,3.41