-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics now counts 300s as success #93
Metrics now counts 300s as success #93
Conversation
Also, 300s are still logged as an error in the Below I echo "GET http://google.com" | ./vegeta attack -duration=1s -rate=1 -redirects=0 | ./vegeta report
Requests [total] 1
Duration [total, attack, wait] 21.246215ms, 0, 21.246215ms
Latencies [mean, 50, 95, 99, max] 21.246215ms, 21.246215ms, 21.246215ms, 21.246215ms, 21.246215ms
Bytes In [total, mean] 0, 0.00
Bytes Out [total, mean] 0, 0.00
Success [ratio] 0.00%
Status Codes [code:count] 0:1
Error Set:
Get http://www.google.com/: stopped after 0 redirects The reason it is added to the Thoughts? |
I'd say you change the error returned by the if result.Error != "" && result.Error != "too many redirects" {
errorSet[result.Error] = struct{}{}
} |
Any reason we shouldn't return a.client.CheckRedirect = func(_ *http.Request, via []*http.Request) error {
if len(via) > n {
return fmt.Errorf("stopped after %d redirects", n)
}
return nil
} to a.client.CheckRedirect = func(_ *http.Request, via []*http.Request) error {
if n > 0 && len(via) > n {
return fmt.Errorf("stopped after %d redirects", n)
}
return nil
} |
From the documentation:
As I understood it, you need to not follow redirects and accept |
Ah, sorry, I clearly didn't dig deep enough. Ok, I'll go this route, thanks. |
Okay, I implemented your suggestion by using a custom error type and added a test which I proved failed, locally, before I made the change. |
@@ -29,6 +30,9 @@ var ( | |||
DefaultLocalAddr = net.IPAddr{IP: net.IPv4zero} | |||
// DefaultTLSConfig is the default tls.Config an Attacker uses. | |||
DefaultTLSConfig = &tls.Config{InsecureSkipVerify: true} | |||
|
|||
// ErrRedirectedButNotFollowing is when the user specifies not to follow redirects but we received one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this too verbose. I'd prefer ErrTooManyRedirects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will change.
On Thu, Nov 13, 2014 at 18:15 Tomás Senart notifications@github.com wrote:
In lib/attack.go:
@@ -29,6 +30,9 @@ var (
DefaultLocalAddr = net.IPAddr{IP: net.IPv4zero}
// DefaultTLSConfig is the default tls.Config an Attacker uses.
DefaultTLSConfig = &tls.Config{InsecureSkipVerify: true}
+
- // ErrRedirectedButNotFollowing is when the user specifies not to follow redirects but we received one
I find this too verbose. I'd prefer ErrTooManyRedirects
—
Reply to this email directly or view it on GitHub
https://github.com/tsenart/vegeta/pull/93/files#r20331482.
adc18fe
to
456dd27
Compare
Followed your recommendations and rebased since the commits would be confusing backtracking. |
…errors Metrics now counts 300s as success
One second! I just did a sanity check and I'm not sure you'll like the results: echo "GET http://google.com" | ./vegeta attack -rate=1 -duration=1s -redirects=0 | ./vegeta report
Requests [total] 1
Duration [total, attack, wait] 802.321656ms, 0, 802.321656ms
Latencies [mean, 50, 95, 99, max] 802.321656ms, 802.321656ms, 802.321656ms, 802.321656ms, 802.321656ms
Bytes In [total, mean] 0, 0.00
Bytes Out [total, mean] 0, 0.00
Success [ratio] 0.00%
Status Codes [code:count] 0:1
Error Set: Would something like this confuse people if it's not successful but it's also not an error? It seems I did not fully think through this, sorry. Notice, success ratio is 0%, it doesn't have the status code - which I'm not sure why since my |
Hmmm. I'll revert this. It's also my fault to merge PRs from my phone at On Fri, Nov 14, 2014, 04:07 Jacques Fuentes notifications@github.com
|
No worries, you should get some rest! If you come up with some good ideas for a strategy I will gladly implement it. Thanks for the hard work on this project. I should probably say: I might have a few more things to add to vegeta as I'm currently building a tool very similar to https://github.com/newsapps/beeswithmachineguns except with your tool as the load tester. I'm hoping to have a basic release in the next few weeks and would like to put a thank you on the README for your awesome tool and speedy help! |
Thanks for the words :-) I'd be glad to know more about that project of yours sometime soon. |
Perhaps this is as simple as checking for the specific error in the |
Thinking a bit more about this made me realise we should actually distinguish between reaching a redirect limit and treating redirects as successes. Sorry for this back and forth. We need two different errors that signal these two cases returned from |
Yeah, that was what I was originally thinking. Okay, what about |
I'm trying to keep combinatorial flag explosion to a minimum. With that in mind, what do you think of giving |
So |
Precisely. |
Hmm, if we can put a short description of the behavior in the help output I think this is fine. I'll start a new PR. |
Yes, this absolutely needs to be well documented. I'd also create a constant in the code which represents this special behaviour. |
Will do. Expect something shortly :) |
refs #88