Class CollectionStats
- java.lang.Object
-
- dev.morphia.aggregation.experimental.stages.Stage
-
- dev.morphia.aggregation.experimental.stages.CollectionStats
-
public class CollectionStats extends Stage
Returns statistics regarding a collection or view.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CollectionStats()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionStats
count(boolean count)
Adds the total number of documents in the collection to the return document.boolean
getCount()
boolean
getHistogram()
Integer
getScale()
CollectionStats
histogram(boolean histogram)
Adds latency histogram information to the embedded documents in latencyStats if true.CollectionStats
scale(Integer scale)
Specify the scale factor (i.e.static CollectionStats
with()
Creates a new collStats stage-
Methods inherited from class dev.morphia.aggregation.experimental.stages.Stage
getStageName
-
-
-
-
Method Detail
-
with
public static CollectionStats with()
Creates a new collStats stage- Returns:
- the new stage
-
count
public CollectionStats count(boolean count)
Adds the total number of documents in the collection to the return document.- Parameters:
count
- true to include the count- Returns:
- this
-
getCount
public boolean getCount()
- Returns:
- whether to get the count
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
getHistogram
public boolean getHistogram()
- Returns:
- whether to add the histogram
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
getScale
public Integer getScale()
- Returns:
- the scale
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
histogram
public CollectionStats histogram(boolean histogram)
Adds latency histogram information to the embedded documents in latencyStats if true.- Parameters:
histogram
- whether to add the histogram- Returns:
- this
-
scale
public CollectionStats scale(Integer scale)
Specify the scale factor (i.e. storageStats: { scale:}) to use the specified scale factor for the various size data. For example, to display kilobytes rather than bytes, specify a scale value of 1024. If you specify a non-integer scale factor, MongoDB uses the integer part of the specified factor. For example, if you specify a scale factor of 1023.999, MongoDB uses 1023 as the scale factor.
The scale factor does not affect those sizes that specify the unit of measurement in the field name, such as "bytes currently in the cache".
- Parameters:
scale
- the scale- Returns:
- this
-
-