[ 
https://issues.apache.org/jira/browse/PHOENIX-1115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rajeshbabu Chintaguntla updated PHOENIX-1115:
---------------------------------------------
    Attachment: PHOENIX-1115_v3.patch

[~jamestaylor] Thanks for the feedback and inputs.
Here is the patch in which changed alter session to trace on/off and make it 
query statement so that it will return high level trace id when tracing 
enabled. The trace id can be used for getting more trace information for the 
queries run after tracing enabled. Here are the queries to enable/disable 
tracing.
1) TRACE ON : enables tracing.
2) TRACE : return tracing status.
3) TRACE OFF: disables tracing.

bq. On our website, we'll document a few canned queries to get the user started:
Yes we can document a few most helpful queries. 
And also we need to give note that the trace information of queries will be 
updated asynchronously so we cannot guarantee full information will available 
in the trace table by the time query/queries execution completed.(Need to 
identify better way how to find the full trace information updated to trace 
table.)

bq. Is the code below to group all batched Put mutations info a single span, 
and if so, can we just always do this (but without the instanceof and check for 
Sampler.ALWAYS), as there's no harm in doing this, right?
Now these changes are not required.

Here is the sample output.

{noformat}
0: jdbc:phoenix:localhost> trace;
+------------------------------------------+
|                  TRACE                   |
+------------------------------------------+
| ON                                       |
+------------------------------------------+
1 row selected (0.003 seconds)
0: jdbc:phoenix:localhost> trace on;
+------------------------------------------+
|                 trace_id                 |
+------------------------------------------+
| 5352016053511552877                      |
+------------------------------------------+
1 row selected (0 seconds)
0: jdbc:phoenix:localhost> trace off;
+--+
|  |
+--+
+--+
No rows selected (0.001 seconds)
0: jdbc:phoenix:localhost> create table t(a integer primary key, b integer);
No rows affected (0.829 seconds)
0: jdbc:phoenix:localhost> trace on;
+------------------------------------------+
|                 trace_id                 |
+------------------------------------------+
| -7024685595315334422                     |
+------------------------------------------+
1 row selected (0.001 seconds)
0: jdbc:phoenix:localhost> upsert into t values(1,2);
1 row affected (0.015 seconds)
0: jdbc:phoenix:localhost> trace off;
+--+
|  |
+--+
+--+
No rows selected (0.001 seconds)
0: jdbc:phoenix:localhost> select * from SYSTEM.TRACING_STATS where 
trace_id=-7024685595315334422;
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+-------------------------------+
|                 TRACE_ID                 |                PARENT_ID           
      |                 SPAN_ID                  |               DESCRIPTION    
            |                START_TIME                |                 
END_TIME                 |                 HOSTNAME      |
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+-------------------------------+
| -7024685595315334422                     | -5659422742808132790               
      | 1996872187404230476                      | ClientService.Multi          
            | 1424868077665                            | 1424868077667          
                  | HW11551.local                 |
| -7024685595315334422                     | -3912386845739108601               
      | -5659422742808132790                     | AsyncProcess.sendMultiAction 
            | 1424868077665                            | 1424868077667          
                  | HW11551.local                 |
| -7024685595315334422                     | -3912386845739108601               
      | 4567626270533726200                      | Writing mutation batch for 
table: T      | 1424868077664                            | 1424868077667        
                    | HW11551.local                 |
| -7024685595315334422                     | -2208980429018441234               
      | -3912386845739108601                     | Committing mutations to 
tables           | 1424868077664                            | 1424868077667     
                       | HW11551.local                 |
| -7024685595315334422                     | 477902                             
      | 1954520860809879161                      | Enabling trace               
            | 1424868058795                            | 1424868098158          
                  | HW11551.local                 |
| -7024685595315334422                     | 1866798122124388264                
      | -2208980429018441234                     | Executing committing 
mutations           | 1424868077664                            | 1424868077667  
                          | HW11551.local                 |
| -7024685595315334422                     | 1954520860809879161                
      | 1866798122124388264                      | Executing 
org.apache.phoenix.jdbc.PhoenixStatement@5096b86b | 1424868077653               
             | 1424868077667                            | HW11551.lo |
| -7024685595315334422                     | 1996872187404230476                
      | -4855623566799879935                     | 
MemStoreFluser.reclaimMemStoreMemory     | 1424868077665                        
    | 1424868077665                            | HW11551.local                 |
| -7024685595315334422                     | 1996872187404230476                
      | -4529973743068930899                     | FSHlog.append                
            | 1424868077666                            | 1424868077666          
                  | HW11551.local                 |
+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+-------------------------------+
9 rows selected (0.108 seconds)

{noformat}

Please review.

> Provide a SQL command to turn tracing on/off
> --------------------------------------------
>
>                 Key: PHOENIX-1115
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1115
>             Project: Phoenix
>          Issue Type: Sub-task
>    Affects Versions: 5.0.0, 4.1
>            Reporter: James Taylor
>            Assignee: Rajeshbabu Chintaguntla
>         Attachments: PHOENIX-1115.patch, PHOENIX-1115_v2.patch, 
> PHOENIX-1115_v3.patch, Screen Shot 2014-11-21 at 3.41.41 PM.png, 
> tracing_in_different_rdbms.pdf
>
>
> Provide a SQL command that turns tracing on and off. For example, Oracle has 
> this:
> {code}
> ALTER SESSION SET sql_trace = true;
> ALTER SESSION SET sql_trace = false;
> {code}
> We might consider allowing the sampling rate to be set as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to