-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use duration
run,The http_reqs
value of K6 is different from the service real request count value.
#898
Comments
This likely happens because when you use We're currently working on refactoring big parts of the script execution and scheduling in k6. One of them would allow us to specify that script iterations (even when running the test with a |
I have a similar problem but this time the k6 reports more requests. I tried it with 1 user for 1 min and the results were accurate. Then I tried it for 1000 users running in a minute and I got k6 output at 3028 and the app I was testing against as 2993. Is there any other metric I can check? |
@priyaananthasankar, the issue you're having isn't the same one described above. It's possible that that in your case, some of the requests k6 is making aren't reaching the system you're testing, potentially because you're saturating your network/server/app/etc. Do you see a bunch of To illustrate, if you run this k6 script: import http from "k6/http";
export default function (data) {
let res = http.get("https://some-non-existent-domain-asdfasdfg.org/");
console.log(res.error_code);
console.log(res.error);
console.log(res.status);
} You'd still get
So, in your case, you can use all of these properties of the import http from "k6/http";
import { Counter } from 'k6/metrics';
let successfulReqs = new Counter('http_successful_reqs');
function myget(url) {
let res = http.get(url);
if (res.status == 200) { // or whatever your definition of successful request is
successfulReqs.add(1);
}
}
export default function (data) {
myget("https://some-non-existent-domain-asdfasdfg.org/");
myget("https://test-api.k6.io/");
myget("https://test.k6.io/");
} the script above would get you
|
k6 script file
java server code
k6 run result
java server result
service:221825 > k6:
http_reqs..................: 221760
Sometimes it will appear k6>server
But there is no problem with specifying
iterations
Is this a thread safety issue or a reality bug?
What can I do?
The text was updated successfully, but these errors were encountered: