Commands: How to get database and server statistics?
There are two types of statistics available. First type of statistics returns server-wide information, the second one returns statistics for particular database.
Database statistics
Database statistics can be downloaded using getStatistics
method in the commands.
Syntax
public DatabaseStatistics getStatistics();
Return Value | |
---|---|
DatabaseStatistics | Current statistics for a database that commands work on |
Example
DatabaseStatistics statistics = store.getDatabaseCommands().getStatistics();
Server statistics
Server statistics can be downloaded using getStatistics
method in GlobalAdmin
commands.
Syntax
public AdminStatistics getStatistics();
Return Value | |
---|---|
AdminStatistics | Current statistics for a server |
Example
AdminStatistics serverStatistics = store.getDatabaseCommands().getGlobalAdmin().getStatistics();