You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by me...@apache.org on 2022/06/23 07:10:16 UTC

[ranger] branch master updated: RANGER-3798 : Ranger API Resource Metrics REST 'Up time of JVM' does not update.

This is an automated email from the ASF dual-hosted git repository.

mehul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new d7541959d RANGER-3798 : Ranger API Resource Metrics REST 'Up time of JVM' does not update.
d7541959d is described below

commit d7541959d5263d97c5cbee07295bc7958571bbc3
Author: Dineshkumar Yadav <di...@outlook.com>
AuthorDate: Tue Jun 21 19:36:17 2022 +0530

    RANGER-3798 : Ranger API Resource Metrics REST 'Up time of JVM' does not update.
    
    Signed-off-by: Mehul Parikh <me...@apache.org>
---
 security-admin/src/main/java/org/apache/ranger/rest/MetricsREST.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/security-admin/src/main/java/org/apache/ranger/rest/MetricsREST.java b/security-admin/src/main/java/org/apache/ranger/rest/MetricsREST.java
index 223bb6ead..5e0bbd592 100644
--- a/security-admin/src/main/java/org/apache/ranger/rest/MetricsREST.java
+++ b/security-admin/src/main/java/org/apache/ranger/rest/MetricsREST.java
@@ -48,7 +48,6 @@ public class MetricsREST {
     private static final String JVM_MACHINE_ACTUAL_NAME = RUNTIME.getVmName();
     private static final String VERSION = RUNTIME.getVmVersion();
     private static final String JVM_MACHINE_REPRESENTATION_NAME = RUNTIME.getName();
-    private static final long UP_TIME_OF_JVM = RUNTIME.getUptime();
     private static final String JVM_VENDOR_NAME =  RUNTIME.getVmVendor();
 
     @Autowired
@@ -67,7 +66,7 @@ public class MetricsREST {
         vmDetails.put("JVM Machine Actual Name", JVM_MACHINE_ACTUAL_NAME);
         vmDetails.put("version", VERSION);
         vmDetails.put("JVM Machine Representation Name", JVM_MACHINE_REPRESENTATION_NAME);
-        vmDetails.put("Up time of JVM", UP_TIME_OF_JVM);
+        vmDetails.put("Up time of JVM", RUNTIME.getUptime());
         vmDetails.put("JVM Vendor Name", JVM_VENDOR_NAME);
         vmDetails.putAll(jvmMetricUtil.getValues());
         jvm.put("jvm",vmDetails);