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

Karan Mehta commented on PHOENIX-4835:
--------------------------------------

Here's what happens according to my understanding.

Whenever the commit method is called on a connection, it internally calls 
{{MutationState#send()}} method. Various mutation metrics are tracked in local 
variables first and in the finally block, these metrics are pushed to the 
mutationMetricQueue for the connection. If commit is never called, the metrics 
are never updated and hence they wont be present in the queue. If commit fails, 
the numFailedMutations count is updated and the MutationMetric is then pushed 
to the queue. 

IMHO, logging on both commit and close makes sense. Once we publish the 
metrics, we anyways clear up the queues. Thereforce, for most times, we would 
never end up publishing any metrics in close.

> LoggingPhoenixConnection should log metrics upon connection close
> -----------------------------------------------------------------
>
>                 Key: PHOENIX-4835
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4835
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Karan Mehta
>            Priority: Major
>         Attachments: PHOENIX-4835.4.x-HBase-1.4.001.patch
>
>
> {{LoggingPhoenixConnection}} currently logs metrics upon {{commit()}}, which 
> may miss the logging of metrics sometimes if commit is never called. We 
> should move it to {{close()}} method instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to