Skip to content

Commit 5bd39ae

Browse files
Fix num OK requests calculation (#25)
1 parent 9334858 commit 5bd39ae

File tree

1 file changed

+4
-2
lines changed
  • src/main/java/com/github/loadtest4j/drivers/wrk

1 file changed

+4
-2
lines changed

src/main/java/com/github/loadtest4j/drivers/wrk/Wrk.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ private static DriverResult toDriverResult(Output output, URI reportUri) {
106106
// 16 requests in 2.06s, 5.50KB read
107107
// Non-2xx or 3xx responses: 16
108108
//
109-
// This means that in wrk parlance, 'requests' = the total number of requests, not the number of OK requests
110-
final long ok = requests - ko;
109+
// This means that in wrk parlance...
110+
// 'requests' = the total number of requests, not the number of OK requests.
111+
// 'errors' = HTTP status errors, not including any socket errors.
112+
final long ok = requests - errors.getStatus();
111113

112114
final ResponseTime responseTime = new WrkResponseTime(output.getLatency().getPercentiles());
113115

0 commit comments

Comments
 (0)