gpt4 book ai didi

azure - 如何获取在 Azure Cosmos DB 中执行存储过程时消耗的 RU 数量?

转载 作者:行者123 更新时间:2023-12-04 15:55:57 24 4
gpt4 key购买 nike

我正在编写一个 Cosmos DB 存储过程,其中包含多个查询。我想知道存储过程执行时消耗的 RU 数量。执行存储过程后,没有消耗 RU 数量的日志,该日志在执行查询时出现。

有什么方法可以查看执行存储过程所消耗的 RU 吗?

最佳答案

据我所知,如果您想获取 Cosmos DB SDK 中 executeStoredProcedure 方法的 RUs,请使用 getRequestCharge() 方法。它不会显示在门户中。

如代码:

StoredProcedureResponse resourceResponse = documentClient.executeStoredProcedure("dbs/db/colls/item/sprocs/b",requestOptions ,null);
System.out.println(resourceResponse.getRequestCharge());

如果你想获取存储过程中内部SQL的请求费用,目前还做不到,可以看这个previous thread .

This is not available today with Azure Cosmos DB. The ['x-ms-request-charge'] value will be in the range of the RUs consumed by the individual operations performed outside the stored procedure.

如果您确实关注此功能,可以提交feedback在这里跟踪进度。

希望对您有帮助。

关于azure - 如何获取在 Azure Cosmos DB 中执行存储过程时消耗的 RU 数量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51650121/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com