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/20 18:46:22 UTC

[GitHub] [cassandra] NateAdere opened a new pull request, #1938: CASSANDRA-16664: Log JVM Arguments at in-JVM Test Class Initialization

NateAdere opened a new pull request, #1938:
URL: https://github.com/apache/cassandra/pull/1938

   Added logging of JVM arguments during class Initialization.
    * Used logSystemInfo() from CassandraDaemon.setup()
    * Included testing for the changes in JVMDTestTest
   
   ```
   patch by Natnael Adere; reviewed by <Reviewers> for CASSANDRA-16664
   
   ```
   
   The [Cassandra Jira](https://issues.apache.org/jira/browse/CASSANDRA-16664)
   
   


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


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

Posted by GitBox <gi...@apache.org>.
maedhroz commented on code in PR #1938:
URL: https://github.com/apache/cassandra/pull/1938#discussion_r1005163942


##########
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:
   Yeah, just make `CassandraDaemon#logSystemInfo()` static and parameterize on the `Logger`.



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


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

Posted by GitBox <gi...@apache.org>.
maedhroz commented on code in PR #1938:
URL: https://github.com/apache/cassandra/pull/1938#discussion_r1005166011


##########
test/distributed/org/apache/cassandra/distributed/impl/Instance.java:
##########
@@ -606,6 +614,8 @@ public void startup(ICluster cluster)
                 // see org.apache.cassandra.service.CassandraDaemon.setup
                 StorageService.instance.populateTokenMetadata();
 
+                logSystemInfo();

Review Comment:
   nit: Just to try to keep maximum continuity w/ `CassandraDaemon`, I'd move this just before `CommitLog.instance.start();` above.



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


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

Posted by GitBox <gi...@apache.org>.
maedhroz commented on code in PR #1938:
URL: https://github.com/apache/cassandra/pull/1938#discussion_r1005166011


##########
test/distributed/org/apache/cassandra/distributed/impl/Instance.java:
##########
@@ -606,6 +614,8 @@ public void startup(ICluster cluster)
                 // see org.apache.cassandra.service.CassandraDaemon.setup
                 StorageService.instance.populateTokenMetadata();
 
+                logSystemInfo();

Review Comment:
   nitL Just to try to keep maximum continuity w/ `CassandraDaemon`, I'd move this just before `CommitLog.instance.start();` above.



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


Re: [PR] CASSANDRA-16664: Log JVM Arguments at in-JVM Test Class Initialization [cassandra]

Posted by "pmcfadin (via GitHub)" <gi...@apache.org>.
pmcfadin commented on PR #1938:
URL: https://github.com/apache/cassandra/pull/1938#issuecomment-4227144150

   Closing as [CASSANDRA-16664](https://issues.apache.org/jira/browse/CASSANDRA-16664) has been resolved as Fixed — if this PR contains changes not captured in the merged fix, please reopen.


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


Re: [PR] CASSANDRA-16664: Log JVM Arguments at in-JVM Test Class Initialization [cassandra]

Posted by "pmcfadin (via GitHub)" <gi...@apache.org>.
pmcfadin closed pull request #1938: CASSANDRA-16664: Log JVM Arguments at in-JVM Test Class Initialization
URL: https://github.com/apache/cassandra/pull/1938


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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
maedhroz commented on code in PR #1938:
URL: https://github.com/apache/cassandra/pull/1938#discussion_r1005160313


##########
test/distributed/org/apache/cassandra/distributed/impl/Instance.java:
##########
@@ -574,6 +581,7 @@ public void startup(ICluster cluster)
             {
                 // org.apache.cassandra.distributed.impl.AbstractCluster.startup sets the exception handler for the thread
                 // so extract it to populate ExecutorFactory.Global
+

Review Comment:
   nit: remove random extra newline?



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