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

technoboy pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new ee02ec6c681 [improve][monitor] Add JVM start time metric (#20381)
ee02ec6c681 is described below

commit ee02ec6c681ab9358e6af77caac0b88a0e627ac3
Author: Jiwei Guo <[email protected]>
AuthorDate: Wed May 24 15:06:34 2023 +0800

    [improve][monitor] Add JVM start time metric (#20381)
---
 .../src/main/java/org/apache/pulsar/common/stats/JvmMetrics.java       | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/pulsar-common/src/main/java/org/apache/pulsar/common/stats/JvmMetrics.java 
b/pulsar-common/src/main/java/org/apache/pulsar/common/stats/JvmMetrics.java
index a35760e53c3..9086b14f7da 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/stats/JvmMetrics.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/stats/JvmMetrics.java
@@ -108,6 +108,9 @@ public class JvmMetrics {
 
         Runtime r = Runtime.getRuntime();
 
+        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
+
+        m.put("jvm_start_time", runtimeMXBean.getStartTime());
         m.put("jvm_heap_used", r.totalMemory() - r.freeMemory());
         m.put("jvm_max_memory", r.maxMemory());
         m.put("jvm_total_memory", r.totalMemory());

Reply via email to