Operations: How to Get Database Statistics
GetStatisticsOperation will retrieve database statistics like: count of documents, indexes, attachments, and more.
Syntax
public GetStatisticsOperation()
Return Value | |
---|---|
DatabaseStatistics |
Database statistics |
Example
DatabaseStatistics stats = store.maintenance().send(new GetStatisticsOperation());
long countOfDocuments = stats.getCountOfDocuments();
int countOfIndexes = stats.getCountOfIndexes();
boolean isStale = stats.getIndexes()[0].isStale();