eriklupander / gotling Goto Github PK
View Code? Open in Web Editor NEWSimple golang-based load test application using YAML documents as specification
License: MIT License
Simple golang-based load test application using YAML documents as specification
License: MIT License
Hi, is Host http header is supported. I want to stress test linkerd service which works with Host http header.
Any help would be appreciated, thanks
hi @eriklupander
for now, gotling only support accept: json
, it'd be good if can support xml as well.
i saw there is golang xmlpath implement the xpath spec.
thanks
I am trying to understand how to use Gotling. I want to run a load test for a fix period of time with ramp-up. Can you please let me know how can I do it. Thank you.
Instead of inlining POST bodies etc, add support for reading those as templates from files. Example syntax:
- http:
method: POST
url: http://localhost:9183/mypostablepath
template: myproject/somepostbody.json
Where myproject is a folder in $GOTLING_HOME/templates
A sample template file could be like this, e.g. uses same ${paramName} syntax:
somepostbody.json
{"name":"${fullName}}", "age":"${age}"}
For the templates, it would be interesting to adapt StringTemplate syntax and capabilities, but that can be evaluated in the future.
for now, gotling only support accept: json
, for some case, i'd like to get the response, read the body but just simply ignore the data.
so, could you add support of this, for example, if we don't specify accept
in the spec, then behavior as read body but ignore?
actually, i'd like to try to contribute PR if you think this is valid requirement.
thanks
Build is broken as github.com/NodePrime/ is no longer there. It is more sensible to include the vendor package inside the main code base.
The project looks awesome - Please fix the build - so that I can try and play with this.
Also, it is worthy of putting on godoc.org...
Great work on the repo btw, I really like the whole idea and design.
I am facing an issue
HTTP request failed: dial tcp xx.xx.xx.xx: connect: cannot assign requested address
My yaml file is like this:
iterations: 10
users: 5000
rampup: 20
with
- sleep:
duration: 5
I am running it on a powerful VM, so memory should not be a problem.
Have you faced something like this?
Hey Erik,
Just want to ask,
Ho do I simulate like 1000 rps initiated (not complete),
and with the yml
file,
how do I setup something like 200 unique users in that 1000 requests?
build the project a have my shoe wet is the way how we evaluate the tool.
so it's better to document the build steps at least in README, even better is there is a kick start script to run, for example, Makefile or so.
anyway, i'm not sure how you build this project,
here is how i did with gb
# vendoring the dependencies
# if we use gb as well, i think you can commit the gb vendor manifest file so that others can easily restore the dependencies.
gb vendor fetch gopkg.in/yaml.v2
gb vendor fetch github.com/NodePrime/jsonpath/cli/jsonpath
gb vendor fetch github.com/gorilla/websocket
gb vendor fetch github.com/tobyhede/go-underscore
# build
gb build
# now the executable binary should be under $PROJECT/bin
at last, thanks for sharing the idea and the project.
Hi, I found this project while looking for a Go-based load testing tool. I totally like it and would love to contribute back some changes I made. I've added back the JSONPath handling and fixed a small bug in the testdef.RANDOM
case in passResultIntoSessionMap
.
Hi Erik,
I thanks for your wonderful contribution since have to fight with gatling session / scala for a long time, without anything I'm already familiar with go lang.
Just curious, since I have to deal with API stress test (most of them used for mobile devices), a lot of side-function have to be perform among requests. How do I do it in gotling?
For example, this is the code snippet I got previously on gatling:
...
val scn_auto = scenario("android_auto")
.exec(http("/api/register")
.post("/api/register")
.header("Accept","application/json, application/*+json")
.header("Authorization", "%s".format(authorizationStr0))
.header("Content-Type", "multipart/form-data;boundary=%s".format(sep0))
.body(
StringBody(
session => body0
)
)
.check(
jsonPath("$.result").saveAs("result0")
)
)
.exec(session => {
result0 = session("result0").as[String]
val decryptText: String = AES.decrypt(result0, todayPadding)
val respJSON = JSON.parseFull(decryptText)
client_id = respJSON
.get
.asInstanceOf[Map[String, Any]]("client_id")
.asInstanceOf[String]
client_secret_key = respJSON
.get
.asInstanceOf[Map[String, Any]]("client_secret_key")
.asInstanceOf[String]
println("client_id -> " + client_id)
println("client_secret_key -> " + client_secret_key)
session.set("sep1", genSep(r, 36)).set("client_id", client_id).set("client_secret_key", client_secret_key)
})
.exec(http("/api/login")
.post("/api/login")
.header("Accept","application/json, application/*+json")
.header(
"Authorization",
session => {
val theClientId = session("client_id").as[String]
Base64.getEncoder.encodeToString(theClientId.getBytes("UTF-8"))
})
.header(
"Content-Type",
session => {
val theSep = session("sep1").as[String]
"multipart/form-data;boundary=%s".format(theSep)
})
.body(
StringBody(
session => {
val theSep = session("sep1").as[String]
val theClientSecretKey = session("client_secret_key").as[String]
genBody(theSep, dataToCryptText(data1, theClientSecretKey))
}
)
)
.check(
jsonPath("$.result").saveAs("result1")
)
)
...
AES.encrypt, AES.decrypt, genBody are my custom functions. Basic workflow is:
How do I do the same thing in gotling?
i saw this https://github.com/rakyll/boom/issues/94, we probably can evaluate it and use it if it really promise.
I am monitoring open connections made by gotling on nginx, and I saw that gotling opened a new connection for each request.
So for instance if I had 100 users, each with 10 iterations, gotling made a total of 1000 new TCP connections to nginx.
I'm not sure if this was the intended behavior, but I did some research, and by moving the code below in httpreq.go
to outside the function DoHttpRequest
(basically making it a global variable):
var DefaultTransport http.RoundTripper = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
reduced the number of new TCP connections.
My guess is that gotling started utilizing persistent connections after this change?
Love to hear your thoughts on this.
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.