You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/10/21 18:55:04 UTC

[GitHub] [cassandra] dcapwell commented on a diff in pull request #1938: CASSANDRA-16664: Log JVM Arguments at in-JVM Test Class Initialization

dcapwell commented on code in PR #1938:
URL: https://github.com/apache/cassandra/pull/1938#discussion_r1002086651


##########
test/distributed/org/apache/cassandra/distributed/impl/Instance.java:
##########
@@ -1138,4 +1148,30 @@ default void run()
             }
         }
     }
+    private void logSystemInfo()
+    {
+        if (inInstancelogger.isInfoEnabled())
+        {
+            try
+            {
+                inInstancelogger.info("Hostname: {}", InetAddress.getLocalHost().getHostName() + ":" + DatabaseDescriptor.getStoragePort() + ":" + DatabaseDescriptor.getSSLStoragePort());
+            }
+            catch (UnknownHostException e1)
+            {
+                inInstancelogger.info("Could not resolve local host");
+            }
+
+            inInstancelogger.info("JVM vendor/version: {}/{}", JAVA_VM_NAME.getString(), JAVA_VERSION.getString());
+            inInstancelogger.info("Heap size: {}/{}",
+                        FBUtilities.prettyPrintMemory(Runtime.getRuntime().totalMemory()),
+                        FBUtilities.prettyPrintMemory(Runtime.getRuntime().maxMemory()));
+
+            for(MemoryPoolMXBean pool: ManagementFactory.getMemoryPoolMXBeans())
+                inInstancelogger.info("{} {}: {}", pool.getName(), pool.getType(), pool.getPeakUsage());
+
+            inInstancelogger.info("Classpath: {}", JAVA_CLASS_PATH.getString());
+
+            inInstancelogger.info("JVM Arguments: {}", ManagementFactory.getRuntimeMXBean().getInputArguments());
+        }

Review Comment:
   rather than mimic we should refactor so we have a function that CassandraDaemon and Instance both call.



-- 
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.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org