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

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


The following commit(s) were added to refs/heads/master by this push:
     new 07f5cc6ea ZOOKEEPER-4792: Use jvm as the prefix for the memory env log.
07f5cc6ea is described below

commit 07f5cc6ea59e1a54f3ffac17bde5eb8af5f6491d
Author: Yan Zhao <[email protected]>
AuthorDate: Wed Feb 7 15:35:30 2024 +0800

    ZOOKEEPER-4792: Use jvm as the prefix for the memory env log.
    
    Reviewers: maoling
    Author: horizonzy
    Closes #2112 from horizonzy/tune-the-jvm-env-log
---
 .../src/main/java/org/apache/zookeeper/Environment.java             | 6 +++---
 .../test/java/org/apache/zookeeper/server/admin/CommandsTest.java   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java 
b/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java
index 425882010..090f7e36c 100644
--- a/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java
@@ -85,9 +85,9 @@ public class Environment {
         // Get memory information.
         Runtime runtime = Runtime.getRuntime();
         int mb = 1024 * 1024;
-        put(l, "os.memory.free", runtime.freeMemory() / mb + "MB");
-        put(l, "os.memory.max", runtime.maxMemory() / mb + "MB");
-        put(l, "os.memory.total", runtime.totalMemory() / mb + "MB");
+        put(l, "jvm.memory.free", runtime.freeMemory() / mb + "MB");
+        put(l, "jvm.memory.max", runtime.maxMemory() / mb + "MB");
+        put(l, "jvm.memory.total", runtime.totalMemory() / mb + "MB");
 
         return l;
     }
diff --git 
a/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java
 
b/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java
index 93c318787..ef8448dd4 100644
--- 
a/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java
+++ 
b/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java
@@ -155,7 +155,7 @@ public class CommandsTest extends ClientBase {
 
     @Test
     public void testEnvironment() throws IOException, InterruptedException {
-        testCommand("environment", new Field("zookeeper.version", 
String.class), new Field("host.name", String.class), new Field("java.version", 
String.class), new Field("java.vendor", String.class), new Field("java.home", 
String.class), new Field("java.class.path", String.class), new 
Field("java.library.path", String.class), new Field("java.io.tmpdir", 
String.class), new Field("java.compiler", String.class), new Field("os.name", 
String.class), new Field("os.arch", String.class), new Fie [...]
+        testCommand("environment", new Field("zookeeper.version", 
String.class), new Field("host.name", String.class), new Field("java.version", 
String.class), new Field("java.vendor", String.class), new Field("java.home", 
String.class), new Field("java.class.path", String.class), new 
Field("java.library.path", String.class), new Field("java.io.tmpdir", 
String.class), new Field("java.compiler", String.class), new Field("os.name", 
String.class), new Field("os.arch", String.class), new Fie [...]
     }
 
     @Test

Reply via email to