Comparison/Threshold of two metrics


I’m trying to load test a service that is a queue consumer and validate the throughput of the system as a result I am loading up the queue with items and awaiting the queue to be empty/all messages having been received on the other side.

What I’m struggling to do is ensure the test only passes when the all the messages have been processed from the queue - As I’m using a counter to count the number of messages sent to the queue and a trend to count the number received on the other end I can’t find any way to either access the metric values in order to trigger a pass/fail - Or threshold on two values to trigger the failure.

Is this currently possible in k6, or am I thinking of things incorrectly.


I do not know If I understood you correctly…
Will that solve your problem: Thresholds ?
You just need to set the rate on sending item and receiving a message at 100%
Or you can access the metrics after the test:
Threshold status after the test
Compare those two numbers and act accordingly. :slight_smile: