[ 
https://issues.apache.org/jira/browse/CASSANDRA-15241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902037#comment-16902037
 ] 

Benedict commented on CASSANDRA-15241:
--------------------------------------

The patch looks good, thanks.  It's a low cost, low risk and valuable insight 
into what the system is doing, so I think it will be really helpful.

I've pushed some minor suggestions 
[here|https://github.com/belliottsmith/cassandra/tree/15241-suggest].

One problem was that the {{task}} field was not guaranteed under the JMM to 
ever see modifications to its contents.  It may be that we typically would see 
them, but we may have to incur the cost of a lazySet to absolutely guarantee 
it.  Unfortunately I don't know of another mechanism for guaranteeing a write 
is made visible eventually from within a loop.

There was also a visibility issue with {{nowNanos}} in 
{{LocalMutationRunnable}}, since the task can be assigned to a worker before it 
runs, at which time the nowNanos will be zero and the running time would look 
absurd.

Finally, there remains an issue with the semantics of the start time - in some 
cases it's when the task starts running, in others when the task was created, 
so including any time spent queued.  If we want, we could quite easily expose 
_both_ of these items, and perhaps we might like to.  But otherwise we should 
pick one and stick to it for all of the implementations.  I would presume we 
are slightly _more_ interested in actual running time, as otherwise tasks 
queued up behind long running tasks might appear long running themselves - 
though this would require the executor to be entirely saturated.

We might also want to put a bit of time into improving the descriptions, to 
include e.g. the CQL being executed.  Right now, for executing a prepared 
statement, we only get the statementId and the options it is invoked with.

> Virtual table to expose current running queries
> -----------------------------------------------
>
>                 Key: CASSANDRA-15241
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15241
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Feature/Virtual Tables
>            Reporter: Chris Lohfink
>            Assignee: Chris Lohfink
>            Priority: Normal
>
> Expose current running queries and their duration.
> {code}cqlsh> select * from system_views.queries;
>  thread_id                    | duration_micros | task
> ------------------------------+-----------------+---------------------------------------------------------------------------------
>  Native-Transport-Requests-17 |            6325 |                      QUERY 
> select * from system_views.queries; [pageSize = 100]
>   Native-Transport-Requests-4 |           14681 | EXECUTE 
> f4115f91190d4acf09e452637f1f2444 with 0 values at consistency LOCAL_ONE
>   Native-Transport-Requests-6 |           14678 | EXECUTE 
> f4115f91190d4acf09e452637f1f2444 with 0 values at consistency LOCAL_ONE
>                  ReadStage-10 |           16535 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                  ReadStage-13 |           16535 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                  ReadStage-14 |           16535 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                  ReadStage-19 |           11861 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                  ReadStage-20 |           11861 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                  ReadStage-22 |            7279 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                  ReadStage-23 |            4716 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                   ReadStage-5 |           16535 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                   ReadStage-7 |           16535 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000
>                   ReadStage-8 |           16535 |                             
>                SELECT * FROM basic.wide1 LIMIT 5000{code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to