see on GitHub

Session : Querying : How to get query statistics?

Query statistics can provide important information about query e.g. duration, total number of results, staleness information, etc. To access statistics use Statistics method.

Syntax

IRavenQueryable<TResult> Statistics(out RavenQueryStatistics stats);

Parameters
stats RavenQueryStatistics Statistics for query.
Return Value
RavenQueryStatistics Statistics for query.

Example

RavenQueryStatistics stats;
List<Employee> employees = session.Query<Employee>()
	.Where(x => x.FirstName == "Robert")
	.Statistics(out stats)
	.ToList();

int totalResults = stats.TotalResults;
long durationMilliseconds = stats.DurationMilliseconds;