hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From " (Commented) (JIRA)" <>
Subject [jira] [Commented] (HIVE-2490) Add reset operation and average time attribute to Metrics MBean.
Date Fri, 07 Oct 2011 19:42:30 GMT

] commented on HIVE-2490:

This is an automatically generated e-mail. To reply, visit:

Review request for hive and Paul Yang.


I added a reset operation which sets the value of all attributes to 0, see
for an explanation of why 0 was chosen and why the attributes are not deleted.

I also added an average time attribute in addition to number and total time.  This seemed
natural as we have all the data we need to calculate it.

Previously, because we were incrementing the number at the beginning of the function, and
the total time at the end of the function, it was impossible to guarantee an accurate average.
 In particular if the frequency of function calls was high and/or the execution time of the
function was very high, the average that could be determined based on the given attributes
could be very inaccurate.

I also added some synchronizations to the Metrics class where I thought it did not appear
to be thread safe.

I based the average and reset API on what is done by Zookeeper in Hadoop.

This addresses bug HIVE-2490.


  trunk/common/src/java/org/apache/hadoop/hive/common/metrics/ 1179884 
  trunk/common/src/java/org/apache/hadoop/hive/common/metrics/ 1179884



I ran an instance of the Metastore, and executed queries against it from multiple clients,
and verified the average attribute and reset operation behaved as expected.



> Add reset operation and average time attribute to Metrics MBean.
> ----------------------------------------------------------------
>                 Key: HIVE-2490
>                 URL:
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Kevin Wilfong
>            Assignee: Kevin Wilfong
> We should add a reset operation to the Metrics MBean, which will set all the counters
to 0.
> Note: Deleting the counters from the map of attributes was not suggested because that
could break any scripts that get the list of attributes from the bean and then the values
of each attribute.  Also, 0 is unlikely to be an actual value for any counter, and it will
not break the increment functionality. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message