tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.42k stars 1.36k forks source link

Latency is not being reported correctly on windows. #670

Open seanalexander opened 10 months ago

seanalexander commented 10 months ago

Version and Runtime

Version: v12.11.1
Commit: 6fbe391628eeeae1adf39522a55078797e6e7f2e
Runtime: go1.20.8 windows/amd64
Date: 2023-10-02T09:05:14Z+0000

Expected Behaviour

      Duration: 10.1604ms
info: Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware[8]
      Duration: 10.5161ms

On linux, I receive this json: { "attack": "", "seq": 0, "code": 200, "timestamp": "2023-12-05T14:38:43.053773-05:00", "latency": 11446800, "bytes_out": 0, "bytes_in": 0, "error": "", "body": null, "method": "GET", "url": "http://localhost:5101/availablestock/Group1/SKU1", "headers": { "Server": [ "Kestrel" ], "Content-Type": [ "application/json; charset=utf-8" ], "Date": [ "Tue, 05 Dec 2023 19:38:42 GMT" ] } }

Actual Behaviour

json results:

{
    "attack": "",
    "seq": 0,
    "code": 200,
    "timestamp": "2023-12-05T14:44:15.5890123-05:00",
    "latency": 10094709800,
    "bytes_out": 0,
    "bytes_in": 0,
    "error": "",
    "body": null,
    "method": "GET",
    "url": "http://localhost:5101/methodname/variable1/variable2",
    "headers": {
        "Server": [
            "Kestrel"
        ],
        "Content-Type": [
            "application/json; charset=utf-8"
        ],
        "Date": [
            "Tue, 05 Dec 2023 19:44:25 GMT"
        ]
    }
}
{
    "attack": "",
    "seq": 1,
    "code": 200,
    "timestamp": "2023-12-05T14:44:16.08811-05:00",
    "latency": 9595612100,
    "bytes_out": 0,
    "bytes_in": 0,
    "error": "",
    "body": null,
    "method": "GET",
    "url": "http://localhost:5101/methodname/variable1/variable2",
    "headers": {
        "Content-Type": [
            "application/json; charset=utf-8"
        ],
        "Date": [
            "Tue, 05 Dec 2023 19:44:25 GMT"
        ],
        "Server": [
            "Kestrel"
        ]
    }
}

Steps to Reproduce

.\vegeta.exe attack -max-body=0 -duration=1s -rate=2 -output="results.bin" -targets=".\attacks_netcore.txt"; ./vegeta encode results.bin | ./vegeta report

Additional Context

is windows defaulting to nanoseconds?