MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / get_query_trace

Method get_query_trace

cassandra/cluster.py:5021–5040  ·  view source on GitHub ↗

Fetches and returns the query trace of the last response, or `None` if tracing was not enabled. Note that this may raise an exception if there are problems retrieving the trace details from Cassandra. If the trace is not available after `max_wait`, :exc:`cas

(self, max_wait=None, query_cl=ConsistencyLevel.LOCAL_ONE)

Source from the content-addressed store, hash-verified

5019 return [trace.trace_id for trace in self._query_traces]
5020
5021 def get_query_trace(self, max_wait=None, query_cl=ConsistencyLevel.LOCAL_ONE):
5022 """
5023 Fetches and returns the query trace of the last response, or `None` if tracing was
5024 not enabled.
5025
5026 Note that this may raise an exception if there are problems retrieving the trace
5027 details from Cassandra. If the trace is not available after `max_wait`,
5028 :exc:`cassandra.query.TraceUnavailable` will be raised.
5029
5030 If the ResponseFuture is not done (async execution) and you try to retrieve the trace,
5031 :exc:`cassandra.query.TraceUnavailable` will be raised.
5032
5033 `query_cl` is the consistency level used to poll the trace tables.
5034 """
5035 if self._final_result is _NOT_SET and self._final_exception is None:
5036 raise TraceUnavailable(
5037 "Trace information was not available. The ResponseFuture is not done.")
5038
5039 if self._query_traces:
5040 return self._get_query_trace(len(self._query_traces) - 1, max_wait, query_cl)
5041
5042 def get_all_query_traces(self, max_wait_per=None, query_cl=ConsistencyLevel.LOCAL_ONE):
5043 """

Callers

nothing calls this directly

Calls 2

_get_query_traceMethod · 0.95
TraceUnavailableClass · 0.90

Tested by

no test coverage detected