# Recommended way to measure latency

**URL:** <https://forum.canton.network/t/recommended-way-to-measure-latency/5160>\
**Category:** App Development\
**Tags:** canton\
**Created:** [September 1, 2022, 12:27pm UTC](https://forum.canton.network/t/recommended-way-to-measure-latency/5160 "2022-09-01T12:27:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![meet](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/meet/32/198_2.png) [@meet](https://forum.canton.network/u/meet)\
**Post date:** [September 1, 2022, 12:27pm UTC](https://forum.canton.network/t/recommended-way-to-measure-latency/5160/1 "2022-09-01T12:27:01Z")

</div>

In order to analyse and improve performance of my Daml code deployed on a Canton network, I want to measure how the total processing time of a transaction is split across all the components in the stack, eg -

1. Time to create the command and send it to the ledger api.

2. Time to unfold the command to a DAML transaction, which may vary based on the size of the transaction and the load on the participant.

3. Time to create a confirmation request (encryption, etc), which may vary based on the size of the transaction and the load on the participant.

4. Time to send the confirmation request to the sequencer, which may vary based on where the sequencer is hosted relative to the participant.

5. Time to process the confirmation request at the sequencer, which may vary based on the load on the sequencer.

What’s the best way to understand how much processing time a Daml command is taking at each of these steps?  
Approach 1 - just look at the logs for various components?  
Approach 2 - would the metrics reported by Canton as per [Monitoring — Daml SDK 2.3.2 documentation](https://docs.daml.com/canton/usermanual/monitoring.html#metrics) be the recommended approach?  
Any other recommendations?

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [September 1, 2022, 12:52pm UTC](https://forum.canton.network/t/recommended-way-to-measure-latency/5160/2 "2022-09-01T12:52:20Z")

</div>

If you want to drill down into individual calls, I can definitely recommend having a look at [tracing](https://docs.daml.com/2.3.2/canton/usermanual/monitoring.html#tracing).
