我们如何计算 运行 Orchestration 功能的总时间

How can we calculate the total time to run the Orchestration function

我有一个管理某些活动的编排功能。我有一个秒表来计算完成这些活动所花费的时间。虽然 运行 它会重置计时器,因为编排触发器会继续重播。有什么解决办法吗

您可以查看持久函数的历史记录 table 并查看执行中每个步骤的不同时间戳:https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-checkpointing-and-replay

This 还描述了为什么不应该在持久函数中使用 Stopwatch 之类的东西。

您不应在 Orchestrator 功能中使用秒表。如果你想要你的编排函数的开始和完成时间,你可以直接检查"DurableFunctionHubInstance" table(函数存储帐户)。