Class: Cql::Client::QueryTrace
- Inherits:
-
Object
- Object
- Cql::Client::QueryTrace
- Defined in:
- lib/cql/client/query_trace.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#coordinator ⇒ Object
readonly
Returns the value of attribute coordinator.
-
#cql ⇒ Object
readonly
Returns the value of attribute cql.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
Instance Method Summary collapse
-
#initialize(session, events) ⇒ QueryTrace
constructor
A new instance of QueryTrace.
Constructor Details
#initialize(session, events) ⇒ QueryTrace
Returns a new instance of QueryTrace.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cql/client/query_trace.rb', line 10 def initialize(session, events) if session raise IncompleteTraceError, 'Trace incomplete, try loading it again' unless session['duration'] @coordinator = session['coordinator'] @cql = (parameters = session['parameters']) && parameters['query'] @started_at = session['started_at'] @duration = session['duration']/1_000_000.0 if events @events = events.map { |e| TraceEvent.new(e) }.freeze end else @events = [].freeze end end |
Instance Attribute Details
#coordinator ⇒ Object (readonly)
Returns the value of attribute coordinator.
7 8 9 |
# File 'lib/cql/client/query_trace.rb', line 7 def coordinator @coordinator end |
#cql ⇒ Object (readonly)
Returns the value of attribute cql.
7 8 9 |
# File 'lib/cql/client/query_trace.rb', line 7 def cql @cql end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
7 8 9 |
# File 'lib/cql/client/query_trace.rb', line 7 def duration @duration end |
#events ⇒ Object (readonly)
Returns the value of attribute events.
7 8 9 |
# File 'lib/cql/client/query_trace.rb', line 7 def events @events end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
7 8 9 |
# File 'lib/cql/client/query_trace.rb', line 7 def started_at @started_at end |