In this template, each client will publish a timestamped message to a unique topic /latency/{{client()}} and will also subscribe to it. The expression in the topic will evaluate to /latency/0 for client 0 and so on at the run time. Once the client receives back the message it has published, it will subtract the received timestamp from the current timestamp and will calculate the loopback delay in millisecond. The delay value will be recorded via metric() API. The key to metric.add() API will be based on the total number of clients used in this demo along with QoS, so we can plot separate metrics for a group of 100 clients, 1000 clients and so on.