[
https://issues.apache.org/jira/browse/PHOENIX-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14351145#comment-14351145
]
Samarth Jain commented on PHOENIX-1691:
---------------------------------------
Thanks for the patch [~rajeshbabu]. Couple of comments:
1) It would be good to add a few error checks. For example:
TRACE OFF WITH SAMPLING 0.5 should fail
2) How is the following case handled:
TRACE ON
execute statement
TRACE ON WITH SAMPLING 0.6
Also,
TRACE ON WITH SAMPLING 0.6
execute statement
TRACE ON
3) Looking at the code and the grammar changes, I am not sure how TRACE ON
still works.
{code}
+ : TRACE (flag = ON ( WITH SAMPLING s = sampling_rate)? | flag = OFF)
+ {ret = factory.trace(Tracing.isTraceOn(flag.getText()), s == null ? 0.0
: (((BigDecimal)s.getValue())).doubleValue());}
{code}
With the above grammar it seems like TRACE ON statement will have the sampling
rate as 0.0. If that is the case then following the code below will leave the
sampler to the default value or the previous value that was set on it. Or am I
missing something?
{code}
+ if (traceStatement.isTraceOn()) {
+ if (conn.getSampler().equals(Sampler.NEVER)) {
+ double samplingRate = traceStatement.getSamplingRate();
+ if (samplingRate >= 1.0) {
+ conn.setSampler(Sampler.ALWAYS);
+ } else if (samplingRate < 1.0 && samplingRate > 0.0) {
+ conn.setSampler(new
ProbabilitySampler(samplingRate));
+ }
}
{code}
> Allow settting sampling rate while enabling tracing.
> ----------------------------------------------------
>
> Key: PHOENIX-1691
> URL: https://issues.apache.org/jira/browse/PHOENIX-1691
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Rajeshbabu Chintaguntla
> Assignee: Rajeshbabu Chintaguntla
> Fix For: 5.0.0, 4.4
>
> Attachments: PHOENIX-1691.patch
>
>
> Now we can dynamically enable/disable tracing from query. We should also be
> able to set sampling rate while enabling tracing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)