Is there way\metrics to capture the start and end time of a particular test run?
Depending on what you mean by “start” time, here are some things you can do:
- get the current time outside of k6 (e.g. with a small shell script) and pass it to k6 as a k6 script environment variable
- get the current time and return in
- use the
k6/executionto get the start time of a single scenario (and/or the whole test, if it just has one scenario)
For the end time, it’s a similar situation, though a bit more limited. You can get the current time in
handleSummary() and use this inside of k6, or get the time in a shell script after k6 finishes running the whole test.