On this page本页内容
db.collection.latencyStats(options)¶mongo Shell Method
This page documents the 本页记录了mongo shell method, and does not refer to the MongoDB Node.js driver (or any other driver) method. mongo shell方法,未提及MongoDB Node.js驱动程序(或任何其他驱动程序)方法。For corresponding MongoDB driver API, refer to your specific MongoDB driver documentation instead.有关相应的MongoDB驱动程序API,请参阅特定的MongoDB驱动程序文档。
db.collection.latencyStats() returns latency statistics for a given collection. 返回给定集合的延迟统计信息。It is a wrapper around 它是一个$collStats.$collStats周围的包装。
This method has the form:此方法的形式如下:
The histograms argument is an optional boolean. histograms参数是可选的布尔值。If 如果histograms: true then latencyStats() adds latency histograms to the return document.histograms:true,那么latencyStats()会将延迟直方图添加到返回文档中。
See also参阅
latencyStats() returns a document containing a field 返回包含字段latencyStats, containing the following fields:latencyStats的文档,该字段包含以下字段:
reads |
|
writes |
|
commands |
Each of these fields contains an embedded document bearing the following fields:每个字段都包含一个嵌入的文档,其中包含以下字段:
latency |
|||||||
ops |
|||||||
histogram |
|
You can run 您可以在latencyStats() in a mongo shell as follows:mongo shell中运行latencyStats(),如下所示:
latencyStats() returns a document such as the following:返回如下文档: