diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.dotnet.markdown index 77b39dae1c..c636b74a12 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.dotnet.markdown @@ -48,7 +48,7 @@ from "Employees" where FirstName == "Anne" | **DurationInMs** | `long` | Query duration on the server side in Milliseconds | | **TotalResults** | `int` | The total count of results that matched the query as `Int32`.
Matching query results can also be counted as `Int32` using [Count](../../../client-api/session/querying/how-to-count-query-results#count). | | **LongTotalResults** | `long` | The total count of the results that matched the query as `Int64`.
Matching query results can also be counted as `Int64` using [LongCount](../../../client-api/session/querying/how-to-count-query-results#longcount). | -| **SkippedResults** | `int` | Gets or sets the [skipped results](../../../indexes/querying/paging#paging-through-tampered-results) | +| **SkippedResults** | `int` | The number of results skipped by the server.
Learn more in [paging through tampered results](../../../indexes/querying/paging#paging-through-tampered-results). | | **Timestamp** | `DateTime` | The time when the query results were unstale | | **IndexName** | `string` | The name of the queried index | | **DateTime** | `IndexTimestamp` | The timestamp of the queried index | diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.java.markdown index c7fb8e90f5..2b4cfc3594 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.java.markdown @@ -1,6 +1,11 @@ -# Session: Querying: How to Get Query Statistics +# Get Query Statistics -Query statistics can provide important information about a query like duration, total number of results, staleness information, etc. To access statistics use the `statistics` method. +Query statistics can provide important information about a query like duration, total number of results, staleness information, etc. +To access statistics use the `statistics` method. + +## Example + +{CODE:java stats_3@ClientApi\Session\Querying\HowToGetQueryStatistics.java /} ## Syntax @@ -10,10 +15,23 @@ Query statistics can provide important information about a query like duration, | ------------- | ------------- | ----- | | **stats** | `QueryStatistics` | Statistics for query. | -## Example - {CODE:java stats_2@ClientApi\Session\Querying\HowToGetQueryStatistics.java /} + +| Property | Type | Description | +|----------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **IsStale** | `boolean` | Are the results returned by the query potentially stale | +| **DurationInMs** | `long` | Query duration on the server side in Milliseconds | +| **TotalResults** | `int` | The total count of results that matched the query as `int` | +| **LongTotalResults** | `long` | The total count of the results that matched the query as `long` | +| **SkippedResults** | `int` | The number of results skipped by the server.
Learn more in [paging through tampered results](../../../indexes/querying/paging#paging-through-tampered-results). | +| **Timestamp** | `Date` | The time when the query results were unstale | +| **IndexName** | `string` | The name of the queried index | +| **indexTimestamp** | `Date` | The timestamp of the queried index | +| **LastQueryTime** | `Date` | The timestamp of the last time the index was queried | +| **ResultEtag** | `Long` | Results Etag | +| **NodeTag** | `String` | Tag of the cluster node that responded to the query | + ## Related articles ### Session diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.js.markdown index 074f59136d..f07432f8dc 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-get-query-statistics.js.markdown @@ -36,19 +36,19 @@ from "Employees" where FirstName == "Anne" |-------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | __statsCallback__ | `(stats) => void` | | -| `QueryStatistics` | | | -|----------------------|-----------|----------------------------------------------------------------------------| -| __isStale__ | `boolean` | Are the results returned by the query potentially stale | -| __durationInMs__ | `number` | Query duration on the server side in Milliseconds | -| __totalResults__ | `number` | The total count of results that matched the query | -| __longTotalResults__ | `number` | The total count of results that matched the query (same as `totalResults`) | -| __skippedResults__ | `number` | Dictionary with `QueryTimings` info per time part | -| __timestamp__ | `Date` | The time when the query results were unstale | -| __indexName__ | `string` | The name of the queried index | -| __indexTimestamp__ | `Date` | The timestamp of the queried index | -| __lastQueryTime__ | `Date` | The timestamp of the last time the index was queried | -| __resultEtag__ | `number` | Results Etag | -| __nodeTag__ | `string` | Tag of the cluster node that responded to the query | +| `QueryStatistics` | | | +|----------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| __isStale__ | `boolean` | Are the results returned by the query potentially stale | +| __durationInMs__ | `number` | Query duration on the server side in Milliseconds | +| __totalResults__ | `number` | The total count of results that matched the query | +| __longTotalResults__ | `number` | The total count of results that matched the query (same as `totalResults`) | +| __skippedResults__ | `number` | The number of results skipped by the server.
Learn more in [paging through tampered results](../../../indexes/querying/paging#paging-through-tampered-results). | +| __timestamp__ | `Date` | The time when the query results were unstale | +| __indexName__ | `string` | The name of the queried index | +| __indexTimestamp__ | `Date` | The timestamp of the queried index | +| __lastQueryTime__ | `Date` | The timestamp of the last time the index was queried | +| __resultEtag__ | `number` | Results Etag | +| __nodeTag__ | `string` | Tag of the cluster node that responded to the query | {PANEL/} diff --git a/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToGetQueryStatistics.java b/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToGetQueryStatistics.java index 8033656e12..1ab3a07c10 100644 --- a/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToGetQueryStatistics.java +++ b/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToGetQueryStatistics.java @@ -15,11 +15,31 @@ private interface IFoo { IDocumentQuery statistics(Reference stats); //endregion } + + private interface Foo { + //region stats_2 + public class QueryStatistics { + + private boolean isStale; + private long durationInMs; + private int totalResults; + private long longTotalResults; + private int skippedResults; + private Date timestamp; + private String indexName; + private Date indexTimestamp; + private Date lastQueryTime; + private Long resultEtag; + private String nodeTag; + + } + //endregion + } public HowToGetQueryStatistics() { try (IDocumentStore store = new DocumentStore()) { try (IDocumentSession session = store.openSession()) { - //region stats_2 + //region stats_3 Reference stats = new Reference<>(); List employees = session.query(Employee.class)