Package dev.morphia.aggregation.stages
Class CollectionStats
- java.lang.Object
-
- dev.morphia.aggregation.stages.Stage
-
- dev.morphia.aggregation.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 Deprecated Methods Modifier and Type Method Description static CollectionStats
collStats()
Creates a new collStats stageCollectionStats
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()
Deprecated, for removal: This API element is subject to removal in a future version.usecollStats()
-
Methods inherited from class dev.morphia.aggregation.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
collStats
public static CollectionStats collStats()
Creates a new collStats stage- Returns:
- the new stage
- Since:
- 2.2
-
with
@Deprecated(forRemoval=true) public static CollectionStats with()
Deprecated, for removal: This API element is subject to removal in a future version.usecollStats()
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
@MorphiaInternal 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
@MorphiaInternal 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
@MorphiaInternal 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
-
-