You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

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();