Updated Branches: refs/heads/cassandra-2.0 d52e7e6fa -> 5522a18a7
cqlsh: handle 'null' as session duration patch by Mikhail Stepura; reviewed by Aleksey Yeschenko for CASSANDRA-6317 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/31027655 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/31027655 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/31027655 Branch: refs/heads/cassandra-2.0 Commit: 310276555e1965fac79a7be0b2ddbbd30cfc3c2e Parents: eb57745 Author: Aleksey Yeschenko <[email protected]> Authored: Sat Nov 9 03:03:49 2013 +0300 Committer: Aleksey Yeschenko <[email protected]> Committed: Sat Nov 9 03:03:49 2013 +0300 ---------------------------------------------------------------------- CHANGES.txt | 1 + pylib/cqlshlib/tracing.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/31027655/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index d27c495..0532a45 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,6 +13,7 @@ * Remove blocking flushes in gossip thread (CASSANDRA-6297) * Fix potential socket leak in connectionpool creation (CASSANDRA-6308) * Allow LOCAL_ONE/LOCAL_QUORUM to work with SimpleSrrategy (CASSANDRA-6238) + * cqlsh: handle 'null' as session duration (CASSANDRA-6317) 1.2.11 http://git-wip-us.apache.org/repos/asf/cassandra/blob/31027655/pylib/cqlshlib/tracing.py ---------------------------------------------------------------------- diff --git a/pylib/cqlshlib/tracing.py b/pylib/cqlshlib/tracing.py index fb8525d..3dc0ba7 100644 --- a/pylib/cqlshlib/tracing.py +++ b/pylib/cqlshlib/tracing.py @@ -43,7 +43,6 @@ def fetch_trace_session(cursor, session_id): "WHERE session_id = %s" % (TRACING_KS, SESSIONS_CF, session_id), consistency_level='ONE') (request, coordinator, started_at, duration) = cursor.fetchone() - cursor.execute("SELECT activity, event_id, source, source_elapsed " "FROM %s.%s " "WHERE session_id = %s" % (TRACING_KS, EVENTS_CF, session_id), @@ -57,8 +56,12 @@ def fetch_trace_session(cursor, session_id): for activity, event_id, source, source_elapsed in events: rows.append([activity, format_timeuuid(event_id), source, source_elapsed]) # append footer row (from sessions table). - finished_at = started_at + (duration / 1000000.) - rows.append(['Request complete', format_timestamp(finished_at), coordinator, duration]) + if duration: + finished_at = format_timestamp(started_at + (duration / 1000000.)) + else: + finished_at = duration = "--" + + rows.append(['Request complete', finished_at, coordinator, duration]) return rows
