klcopp commented on a change in pull request #2158:
URL: https://github.com/apache/hive/pull/2158#discussion_r608657504
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/AcidMetricService.java
##########
@@ -86,22 +88,21 @@ private void collectMetrics() throws MetaException {
private void updateDBMetrics() throws MetaException {
MetricsInfo metrics = txnHandler.getMetricsInfo();
- Metrics.getOrCreateGauge(MetricsConstants.COMPACTION_STATUS_PREFIX +
"txn_to_writeid").set(
- metrics.getTxnToWriteIdCount());
- Metrics.getOrCreateGauge(MetricsConstants.COMPACTION_STATUS_PREFIX +
"completed_txn_components").set(
- metrics.getCompletedTxnsCount());
- Metrics.getOrCreateGauge(MetricsConstants.COMPACTION_STATUS_PREFIX +
"open_txn").set(
- metrics.getOpenTxnsCount());
- Metrics.getOrCreateGauge(MetricsConstants.OLDEST_OPEN_TXN_ID ).set(
- metrics.getOldestOpenTxnId());
- Metrics.getOrCreateGauge(MetricsConstants.OLDEST_OPEN_TXN_AGE ).set(
- metrics.getOldestOpenTxnAge());
- Metrics.getOrCreateGauge(MetricsConstants.NUM_ABORTED_TXNS).set(
- metrics.getAbortedTxnsCount());
- Metrics.getOrCreateGauge(MetricsConstants.OLDEST_ABORTED_TXN_ID).set(
- metrics.getOldestAbortedTxnId());
- Metrics.getOrCreateGauge(MetricsConstants.OLDEST_ABORTED_TXN_AGE).set(
- metrics.getOldestAbortedTxnAge());
+
Metrics.getOrCreateGauge(NUM_TXN_TO_WRITEID).set(metrics.getTxnToWriteIdCount());
+
Metrics.getOrCreateGauge(NUM_COMPLETED_TXN_COMPONENTS).set(metrics.getCompletedTxnsCount());
+
+ // NOTE: AcidOpenTxnsCounterService has a duplicate countOpenTxns()
functionality and could be disabled.
+ // PS: make sure to update `numOpenTxns` counter in TxnHandler.
+ Metrics.getOrCreateGauge(NUM_OPEN_TXNS).set(metrics.getOpenTxnsCount());
+
Metrics.getOrCreateGauge(OLDEST_OPEN_TXN_ID).set(metrics.getOldestOpenTxnId());
+
Metrics.getOrCreateGauge(OLDEST_OPEN_TXN_AGE).set(metrics.getOldestOpenTxnAge());
+
+
Metrics.getOrCreateGauge(NUM_ABORTED_TXNS).set(metrics.getAbortedTxnsCount());
+
Metrics.getOrCreateGauge(OLDEST_ABORTED_TXN_ID).set(metrics.getOldestAbortedTxnId());
+
Metrics.getOrCreateGauge(OLDEST_ABORTED_TXN_AGE).set(metrics.getOldestAbortedTxnAge());
+
+ Metrics.getOrCreateGauge(NUM_LOCKS).set(metrics.getLocksCount());
+ Metrics.getOrCreateGauge(OLDEST_LOCK_AGE).set(metrics.getOldestLockAge());
Review comment:
Since these metrics aren't connected to compaction (they apply to
non-acid tables) is there some other place we could collect them?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]