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

DatabaseStatistics GetStatistics();
Return Value
DatabaseStatistics Current statistics for a database that commands work on

Example

DatabaseStatistics statistics = store.DatabaseCommands.GetStatistics();

Server statistics

Server statistics can be downloaded using GetStatistics method in GlobalAdmin commands.

Syntax

AdminStatistics GetStatistics();
Return Value
AdminStatistics Current statistics for a server

Example

AdminStatistics serverStatistics = store
	.DatabaseCommands
	.GlobalAdmin
	.GetStatistics();