Package com.couchbase.client.java.query
Class N1qlMetrics
java.lang.Object
com.couchbase.client.java.query.N1qlMetrics
- All Implemented Interfaces:
Serializable
@Committed @Public public class N1qlMetrics extends Object implements Serializable
A class that represents N1QL metrics.
Note that the server could omit the metrics or part of the metrics,
in which case an
EMPTY_METRICS
will be returned.- Since:
- 2.1
- Author:
- Simon Baslé
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static N1qlMetrics
EMPTY_METRICS
The empty metrics object.static String
NO_TIME
Human-readable representation of the absence of duration, as "0s". -
Constructor Summary
Constructors Constructor Description N1qlMetrics(JsonObject rawMetrics)
-
Method Summary
Modifier and Type Method Description JsonObject
asJsonObject()
Exposes the underlying raw form of the metrics, as aJsonObject
.String
elapsedTime()
int
errorCount()
String
executionTime()
int
mutationCount()
int
resultCount()
long
resultSize()
int
sortCount()
String
toString()
int
warningCount()
-
Field Details
-
EMPTY_METRICS
The empty metrics object. All numerical values will be 0 and human-readable times will beNO_TIME
. -
NO_TIME
Human-readable representation of the absence of duration, as "0s".- See Also:
- Constant Field Values
-
-
Constructor Details
-
N1qlMetrics
-
-
Method Details
-
elapsedTime
- Returns:
- The total time taken for the request, that is the time from when the request was received until the results were returned, in a human-readable format (eg. 123.45ms for a little over 123 milliseconds).
-
executionTime
- Returns:
- The time taken for the execution of the request, that is the time from when query execution started until the results were returned, in a human-readable format (eg. 123.45ms for a little over 123 milliseconds).
-
sortCount
public int sortCount()- Returns:
- the total number of results selected by the engine before restriction through LIMIT clause.
-
resultCount
public int resultCount()- Returns:
- The total number of objects in the results.
-
resultSize
public long resultSize()- Returns:
- The total number of bytes in the results.
-
mutationCount
public int mutationCount()- Returns:
- The number of mutations that were made during the request.
-
errorCount
public int errorCount()- Returns:
- The number of errors that occurred during the request.
-
warningCount
public int warningCount()- Returns:
- The number of warnings that occurred during the request.
-
asJsonObject
Exposes the underlying raw form of the metrics, as aJsonObject
. Note that values exposed as methods are cached at instantiation, so this object is not backed by the returned JsonObject.- Returns:
- the underlying raw form of the metrics.
-
toString
-