mrichman / hargo Goto Github PK
View Code? Open in Web Editor NEWHargo is a Go library and command line utility that parses HAR files, can convert to curl format, and serve as a load test driver.
License: MIT License
Hargo is a Go library and command line utility that parses HAR files, can convert to curl format, and serve as a load test driver.
License: MIT License
Thank you very much for the project!
I made a few changes for my use case.
diff --git a/curl.go b/curl.go
index 4e3fe88..69300c1 100644
--- a/curl.go
+++ b/curl.go
@@ -54,7 +54,13 @@ func fromEntry(entry Entry) (string, error) {
}
for _, h := range entry.Request.Headers {
- command += " -H \"" + h.Name + ": " + h.Value + "\" "
+ if strings.EqualFold(h.Name, "cookie") {
+ continue
+ }
+ if strings.HasPrefix(h.Name, ":") {
+ continue
+ }
+ command += " -H \"" + h.Name + ": " + strings.ReplaceAll(h.Value, "\"", "\\\"") + "\" "
}
if entry.Request.Method == "POST" && len(entry.Request.PostData.Text) > 0 {
When a load test is started with a large har file that cannot be processed in the given duration, no results will be written in InfluxDB. This is because the waitTimeout func will stop the load test before the results are pushed to InfluxDB.
Regarding this issue I've made a pull request #19
I found the following error:
cmd\hargo\hargo.go:13:2: cannot find package "github.com/urfave/cli" in any of:
C:\Go\src\github.com\urfave\cli (from $GOROOT)
C:\Users\Csuto\go\src\github.com\urfave\cli (from $GOPATH)
I found out that happened as the cli has changed its repository (or whatever it called in GO, I haven't ever used it before).
The new repository is: gopkg.in/urfave/cli.v1
. It should be changed in hargo.go
import part, and in the dependecies.
Workaround:
Change it in hargo.go and run go get gopkg.in/urfave/cli.v1
.
Hey there -- was trying this package out and went down a rabbit hole trying to figure out why I couldn't get the latest version. After some detective work I noticed that your latest version is tagged 0.1.2
(no v) whereas the previous version was v0.1.1
.
I suspect this is causing people to not get 0.1.1
when they pull.
this project is awesome
It helped me to solve har parsing related issues
It would be better if the files downloaded by the hargo fetch command can be placed according to the directory
$ go get github.com/mrichman/hargo
$ cd $GOPATH/src/github.com/mrichman/hargo
-bash: cd: /Users/ishandutta2007/gopath/src/github.com/mrichman/hargo: No such file or directory
$ echo $GOPATH
/Users/ishandutta2007/gopath
$ ls /Users/ishandutta2007/gopath
$
The version of the connector is old, please update it to work with influxdb 1.5 (the most common version).
Hi there! Just wanted to provide some feedback on some ways you could improve the json struct tags in hargo:
Text string `json:"omitempty"`
What you're doing here is telling the json unmarshaler to look for the field omitempty
in the json object, which isn't what you want. What I think you're trying to do is this:
Text string `json:",omitempty"`
Which tells it to look for text
or Text
in the json object, and omit the field when marshaling if it's empty.
Text string `json:"text,omitempty"`
would make it so that once you have a Har unmarshaled into your program you can unmarshal it again into the same form, rather than a new set of objects with different field names that can't be used by chrome or any other tool which is reading in Har as json objects.
I'm going to make a fork of your project and implement these changes, if you like I can PR them back up. Thanks for all the work on it so far, it's been really helpful!
If there is a call to "ws:" the library exists with error.
Be able to ignore this calls.
When I run go get github.com/mrichman/hargo
I receive this error "can't load package: package github.com/mrichman/hargo: no Go files in /Users/billy/go/src/github.com/mrichman/hargo"
Can someone explain what I'm doing wrong?
Thanks!
Think times are used to simulate human behavior that causes people to wait between interactions with a Web site. Think times occur between requests in a Web performance test and between test iterations in a load test scenario. Using think times in a load test can be useful in creating more accurate load simulations.
Without think times, URLs are requested as quickly as possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.