-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pulsar-perf: Dump JVM information #9769
Conversation
@codelipenghui @wolfstudy picking this to 2.7.1 will be very useful |
public static void printJVMInformation(Logger log) { | ||
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); | ||
log.info("Java Runtime Info"); | ||
System.getProperties().forEach( (k,v)-> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been annoyed by ZK printing this (and classpath) for many years! :(
Can we keep it at just the args and the memory size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. that information is not very useful, only to report easily about the env.
@merlimat we can hide that information in ZooKeeper, https://issues.apache.org/jira/browse/ZOOKEEPER-4228
} | ||
}); | ||
log.info("JVM args {}", runtimeMXBean.getInputArguments()); | ||
log.info("Netty max memory (PlatformDependent.maxDirectMemory()) {}", PlatformDependent.maxDirectMemory()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we convert it to GB to make it easier to read?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
I am using now an utility from Commons IO in order to pretty print the value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merlimat I have addressed your comments.
PTAL
@codelipenghui please consider merging this patch to 2.7.1
* Print JVM info while running pulsar-perf commands * Address Matteo's comments Co-authored-by: Enrico Olivelli <eolivelli@apache.org> (cherry picked from commit 7643897)
* Print JVM info while running pulsar-perf commands * Address Matteo's comments Co-authored-by: Enrico Olivelli <eolivelli@apache.org> (cherry picked from commit 7643897)
Relates to #9721
Motivation
Is it really useful to have a summary of JVM configuration when you are working with pulsar-perf.
This is because that configuration may affect the execution of the test, but also with that piece of information you can easily troubleshot problems like #9721
Modifications
Log JVM configuration at boot:
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.