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(Reference<RavenQueryStatistics> stats);

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

Example

Reference<RavenQueryStatistics> statsRef = new Reference<>();
QEmployee e = QEmployee.employee;
List<Employee> employees = session
  .query(Employee.class)
  .where(e.firstName.eq("Robert"))
  .statistics(statsRef)
  .toList();

int totalResults = statsRef.value.getTotalResults();
long durationMiliseconds = statsRef.value.getDurationMiliseconds();