Add some missing tracing documentation
This commit is contained in:
@@ -27,6 +27,12 @@ class Query(object):
|
|||||||
will be retried.
|
will be retried.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
trace = None
|
||||||
|
"""
|
||||||
|
If :meth:`.Session.execute()` is run with `trace` set to :const:`True`,
|
||||||
|
this will be set to a :class:`.QueryTrace` instance.
|
||||||
|
"""
|
||||||
|
|
||||||
consistency_level = ConsistencyLevel.ONE
|
consistency_level = ConsistencyLevel.ONE
|
||||||
"""
|
"""
|
||||||
The :class:`.ConsistencyLevel` to be used for this operation. Defaults
|
The :class:`.ConsistencyLevel` to be used for this operation. Defaults
|
||||||
@@ -301,7 +307,7 @@ class QueryTrace(object):
|
|||||||
|
|
||||||
events = None
|
events = None
|
||||||
"""
|
"""
|
||||||
A chronologically sorted list of :class:`.TracingEvent` instances
|
A chronologically sorted list of :class:`.TraceEvent` instances
|
||||||
representing the steps the traced operation went through. This
|
representing the steps the traced operation went through. This
|
||||||
corresponds to the rows in ``system_traces.events`` for this tracing
|
corresponds to the rows in ``system_traces.events`` for this tracing
|
||||||
session.
|
session.
|
||||||
@@ -353,19 +359,43 @@ class QueryTrace(object):
|
|||||||
|
|
||||||
|
|
||||||
class TraceEvent(object):
|
class TraceEvent(object):
|
||||||
|
"""
|
||||||
|
Representation of a single event within a query trace.
|
||||||
|
"""
|
||||||
|
|
||||||
|
description = None
|
||||||
|
"""
|
||||||
|
A brief description of the event.
|
||||||
|
"""
|
||||||
|
|
||||||
|
datetime = None
|
||||||
|
"""
|
||||||
|
A UTC :class:`datetime.datetime` marking when the event occurred.
|
||||||
|
"""
|
||||||
|
|
||||||
name = None
|
|
||||||
happened_at = None
|
|
||||||
source = None
|
source = None
|
||||||
source_elapsed = None
|
"""
|
||||||
thread_name = None
|
The IP address of the node this event occurred on.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, name, timeuuid, source, source_elapsed, thread_name):
|
source_elapsed = None
|
||||||
self.name = name
|
"""
|
||||||
self.happened_at = datetime.utcfromtimestamp(unix_time_from_uuid1(timeuuid))
|
A :class:`datetime.timedelta` measuring the amount of time until
|
||||||
|
this event occurred starting from when :attr:`.source` first
|
||||||
|
received the query.
|
||||||
|
"""
|
||||||
|
|
||||||
|
thread_name = None
|
||||||
|
"""
|
||||||
|
The name of the thread that this event occurred on.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, description, timeuuid, source, source_elapsed, thread_name):
|
||||||
|
self.description = description
|
||||||
|
self.datetime = datetime.utcfromtimestamp(unix_time_from_uuid1(timeuuid))
|
||||||
self.source = source
|
self.source = source
|
||||||
self.source_elapsed = timedelta(microseconds=source_elapsed)
|
self.source_elapsed = timedelta(microseconds=source_elapsed)
|
||||||
self.thread_name = thread_name
|
self.thread_name = thread_name
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s on %s[%s] at %s" % (self.name, self.source, self.thread_name, self.happened_at)
|
return "%s on %s[%s] at %s" % (self.description, self.source, self.thread_name, self.datetime)
|
||||||
|
|||||||
@@ -16,3 +16,10 @@
|
|||||||
:members:
|
:members:
|
||||||
|
|
||||||
.. autoclass:: ValueSequence
|
.. autoclass:: ValueSequence
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: QueryTrace ()
|
||||||
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: TraceEvent ()
|
||||||
|
:members:
|
||||||
|
|||||||
Reference in New Issue
Block a user