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)
| 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 | """ |
nothing calls this directly
no test coverage detected