Analytics
- class couchbase.analytics.AnalyticsError(record: _AnalyticsProblemRecord)
An error the analytics service reported for a query.
- class couchbase.analytics.AnalyticsMetaData(record: _AnalyticsMetaDataRecord)
The metadata the analytics service returned with a query’s rows.
- client_context_id() str
Get the client context ID which is associated with the executed query.
- Returns:
The client context ID which is associated with the executed query.
- Return type:
- errors() list[AnalyticsError]
Get errors that occurred during the execution of the query.
- Returns:
Any errors that occurred during the execution of the query.
- Return type:
list[
AnalyticsError]
- metrics() AnalyticsMetrics | None
Get the metrics the analytics service reported for the query.
- Returns:
The query’s metrics, if the service sent them.
- Return type:
AnalyticsMetrics| None
- request_id() str
Get the request ID which is associated with the executed query.
- Returns:
The request ID which is associated with the executed query.
- Return type:
- signature() str | int | float | bool | None | Mapping[str, Any] | Sequence[Any]
Get the signature of the query.
- Returns:
The signature of the query, if the service sent one.
- Return type:
JSONType | None
- status() AnalyticsStatus
Get the status of the query at the time the query metadata was generated.
- Returns:
The status of the query at the time the query metadata was generated.
- Return type:
- warnings() list[AnalyticsWarning]
Get warnings that occurred during the execution of the query.
- Returns:
Any warnings that occurred during the execution of the query.
- Return type:
list[
AnalyticsWarning]
- class couchbase.analytics.AnalyticsMetrics(record: _AnalyticsMetricsRecord)
The metrics the analytics service reported for a query.
- elapsed_time() timedelta
Get the total amount of time spent running the query.
- Returns:
The total amount of time spent running the query.
- Return type:
- error_count() UnsignedInt64
Get the total number of errors which were encountered during the execution of the query.
- Returns:
- The total number of errors which were encountered during the
execution of the query.
- Return type:
- execution_time() timedelta
Get the total amount of time spent executing the query.
- Returns:
The total amount of time spent executing the query.
- Return type:
- processed_objects() UnsignedInt64
Get the total number of objects the query processed.
- Returns:
The total number of objects the query processed.
- Return type:
- result_count() UnsignedInt64
Get the total number of rows which were part of the result set.
- Returns:
The total number of rows which were part of the result set.
- Return type:
- result_size() UnsignedInt64
Get the total number of bytes which were generated as part of the result set.
- Returns:
- The total number of bytes which were generated as part of the
result set.
- Return type:
- warning_count() UnsignedInt64
Get the total number of warnings which were encountered during the execution of the query.
- Returns:
- The total number of warnings which were encountered during the
execution of the query.
- Return type:
- class couchbase.analytics.AnalyticsScanConsistency(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
How current the data an analytics query reads must be.
NOT_BOUNDEDreads what the service has already ingested, which is fastest but may miss recent mutations.REQUEST_PLUSwaits until the service has ingested every mutation made before the query.- NOT_BOUNDED = 'not_bounded'
- REQUEST_PLUS = 'request_plus'
- class couchbase.analytics.AnalyticsStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Represents the status of an analytics query.
- ABORTED = 'aborted'
- CLOSED = 'closed'
- COMPLETED = 'completed'
- ERRORS = 'errors'
- FATAL = 'fatal'
- RUNNING = 'running'
- STOPPED = 'stopped'
- SUCCESS = 'success'
- TIMEOUT = 'timeout'
- UNKNOWN = 'unknown'