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

Aleksey Yeschenko commented on CASSANDRA-7719:
----------------------------------------------

Got a few nits/questions:

1. Why do we bother with incrementing activePreparedStatements counter, when we 
could instead make it a Gauge and return the sum of preparedStatements.size() 
and thriftPreparedStatements.size() (w/ some method in QP exposing the overall 
sum)
2. Logging "Stored prepared statement (hash) with  bind markers", even at 
trace, seems absolutely useless in practice to me
3. In general, we seem to prefer Math.max(1, foo) to a ternary foo == 0 ? 1 : 
foo style elsewhere in the codebase
4. activePreparedStatements/"ActivePreparedStatements" vs. 
executed(Un)Prepared/"Executed(Un)Prepared" naming is inconsistent, and should 
be standardized (I vote change the latter to 
executedPreparedStatements/"ExecutedPreparedStatements" style) - the metric 
names are public and must be consistent, while inconsistent variable names are 
merely a nit
5. Should 'unprepared' be 'non-prepared'?

> Add PreparedStatements related metrics
> --------------------------------------
>
>                 Key: CASSANDRA-7719
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7719
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michaël Figuière
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 2.1.1
>
>         Attachments: 7719.txt
>
>
> Cassandra newcomers often don't understand that they're expected to use 
> PreparedStatements for almost all of their repetitive queries executed in 
> production.
> It doesn't look like Cassandra currently expose any PreparedStatements 
> related metrics.It would be interesting, and I believe fairly simple, to add 
> several of them to make it possible, in development / management / monitoring 
> tools, to show warnings or alerts related to this bad practice.
> Thus I would suggest to add the following metrics:
> * Executed prepared statements count
> * Executed unprepared statements count
> * Amount of PreparedStatements that have been registered on the node



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

Reply via email to