Hargo parses HAR files, can convert to curl format, and serve as a load test driver.
NAME: hargo - work with HTTP Archive (.har) files USAGE: hargo <command> [arguments] <.har file> VERSION: 0.1.1-dev.5 (e9e0b9c) AUTHOR(S): Mark A. Richman <email@example.com> COMMANDS: fetch, f Fetch URLs in .har curl, c Convert .har to curl run, r Run .har file validate, v Validate .har file dump, d Dump .har file load, l Load test .har file help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --debug enable verbose (debug) logging --help, -h show help --version, -v print the version COPYRIGHT: (c) 2016 Mark A. Richman
go get github.com/mrichman/hargo cd $GOPATH/src/github.com/mrichman/hargo go run cmd/hargo/hargo.go validate test/golang.org.har
Building from source
Make sure that you have Go version 1.7 or greater (I haven't tested with lower) and that your
GOPATH env variable is set (I recommand setting it to
~/go if you don't have one). If
GOBIN is not set, also try setting that to
make install may fail. You can check all Go environment variables with
go get -d github.com/mrichman/hargo cd $GOPATH/src/github.com/mrichman/hargo make install
About HAR Files
If you use Google Chrome, you can record these files by following the steps below:
- Right-click anywhere on that page and click on Inspect Element to open Chrome's Developer Tools
- The Developer Tools will open as a panel at the bottom of the page. Click on the Network tab.
- Click the Record button, which is the solid black circle at the bottom of the Network tab, and you'll start recording activity in your browser.
- Refresh the page and start working normally
- Right-click within the Network tab and click Save as HAR with Content to save a copy of the activity that you recorded.
- Within the file window, save the HAR file.
fetch command downloads all resources references in .har file:
hargo fetch foo.har
This will produce a directory named
hargo-fetch-yyyymmddhhmmss containing all assets references by the .har file. This is similar to what you'd see when invoking
wget on a particular URL.
curl command will output a curl command line for each entry in the .har file.
hargo curl foo.har
run command executes each HTTP request in .har file:
hargo run foo.har
This is similar to
fetch but will not save any output.
validate command will report any errors in the format of a .har file.
hargo validate foo.har
HAR file format is defined here: https://w3c.github.io/web-performance/specs/HAR/Overview.html
Dump prints information about all HTTP requests in .har file
hargo dump foo.har
Hargo can act as a load test agent. Given a .har file, hargo can spawn a number of concurrent workers to repeat each HTTP request in order. By default, hargo will spawn 10 workers and run for a duration of 60 seconds.
Hargo will also save its results to InfluxDB, if available. Each HTTP response is stored as a point of time-series data, which can be graphed by Chronograf, Grafana, or similar visualization tool for analysis.
If you find any bugs, please report them! I am also happy to accept pull requests from anyone.
You can use the GitHub issue tracker to report bugs, ask questions, or suggest new features.
For a more informal setting to discuss this project, you can join the Gitter chat.