我正在尝试使用Java SDK获取当前为DocumentDB集合分配的RU . 有人有任何投入吗?
您正在寻找的是查询集合的Offer或OfferV2的方法 .
正如您所看到的,here OfferV2具有集合吞吐量的set和get方法 . Offer(v1)也将包含该属性's a Resource at it'的代码
您可以使用 AsyncDocumentClient 中的 readOffer(string collectionSelfLink) 方法读取商品,以便检索商品,然后使用 offer.getContent().getInt("offerThroughput"); 获取商品的RU / s .
AsyncDocumentClient
readOffer(string collectionSelfLink)
offer.getContent().getInt("offerThroughput");
将它转换为 OfferV2 应该也可以工作,这使您可以访问 getOfferThroughput() (内部记录将执行上面的行)
OfferV2
getOfferThroughput()
您可以使用
public int getRequstUnits(DocumentClient client, DocumentCollection coll) { return getOffer(client, coll).getContent().getInt("offerThroughput"); }
看看这里的 complete code sample
2 回答
您正在寻找的是查询集合的Offer或OfferV2的方法 .
正如您所看到的,here OfferV2具有集合吞吐量的set和get方法 . Offer(v1)也将包含该属性's a Resource at it'的代码
您可以使用
AsyncDocumentClient
中的readOffer(string collectionSelfLink)
方法读取商品,以便检索商品,然后使用offer.getContent().getInt("offerThroughput");
获取商品的RU / s .将它转换为
OfferV2
应该也可以工作,这使您可以访问getOfferThroughput()
(内部记录将执行上面的行)您可以使用
看看这里的 complete code sample