-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat(attributes): add methods to extract all readable MBeanAttributes from various mxbeans #174
feat(attributes): add methods to extract all readable MBeanAttributes from various mxbeans #174
Conversation
5547fd3
to
265cdde
Compare
Querying the query {
targetNodes(filter: { name: "service:jmx:rmi:///jndi/rmi://cryostat:9093/jmxrmi" }) {
jmxMetrics {
runtime {
inputArguments
}
thread {
allThreadIds
currentThreadCpuTime
currentThreadUserTime
threadCount
peakThreadCount
}
os {
arch
}
memory {
heapMemoryUsage {
used
}
nonHeapMemoryUsage {
used
}
}
}
}
}
|
|
Oh, I know what I did, I just forgot that I was changed something accidently in the |
private Object parseObject(Object obj) { | ||
if (obj instanceof CompositeData) { | ||
CompositeData cd = (CompositeData) obj; | ||
if (cd.getCompositeType().getTypeName().equals("java.lang.management.MemoryUsage")) |
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.
Maybe rather than the string value this could be MemoryUsage.class.getName()
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.
Do you think it would be worthwhile to refactor the JVM ID function:
public synchronized String getJvmId() throws IDException, IOException { |
to call into getMBeanMetrics()
?
Hmm... it would be convenient to put all these metric data things into one function but there's one thing I'm wondering about. To get the jvmID then using graphql, the server (-core) side also has to calculate all the mbean attributes before the graphql fetcher filters the output so there's a bit more overhead from that. Unless that can be changed so that the -core side only retrieves certain mbean attributes specified by the graphql query. That would be nice but I'm not sure how to do that. Which do you think is best? |
This needs some profiling work to determine for sure but I suspect that the large bulk of the overhead comes from actually establishing the JMX connection. Once it's opened the various MBean operations should be relatively negligible, so picking and choosing which to do vs just doing them all and filtering out the response data to serialize out doesn't seem like it should be too bad. This is an operation that should only be occurring once every few seconds at most per target JVM while the user is looking at its monitoring dashboard, so it doesn't seem like the overall performance overhead should be substantial. |
Does something like this make sense? |
1dd4cbf
to
97245b6
Compare
555bd19
to
6983d3f
Compare
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
6983d3f
to
7d815a7
Compare
… from various mxbeans (cryostatio#174) * add details methods Signed-off-by: Max Cao <macao@redhat.com> * collectors import * use explicit attributes Signed-off-by: Max Cao <macao@redhat.com> * remove overrides Signed-off-by: Max Cao <macao@redhat.com> * refactor to remove details from query field Signed-off-by: Max Cao <macao@redhat.com> * refactor * some cleanup Signed-off-by: Max Cao <macao@redhat.com> * default values for gson Signed-off-by: Max Cao <macao@redhat.com> * refactor to remove extra 'attributes' field Signed-off-by: Max Cao <macao@redhat.com> * remove unnecessary function Signed-off-by: Max Cao <macao@redhat.com> * remove custom type Signed-off-by: Max Cao <macao@redhat.com> * change hardcoded classname to use actual class name Signed-off-by: Max Cao <macao@redhat.com> * add jvmId to mbeanMetrics Signed-off-by: Max Cao <macao@redhat.com> * writeLong Signed-off-by: Max Cao <macao@redhat.com> --------- Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao macao@redhat.com
Related https://github.com/cryostatio/cryostat/issues/1360
There is a bunch of commented out methods that I tried to use before I realized that every JVM may have different attributes for these beans depending on their version so it doesn't make sense to have a field for each of them. I keep the comments just for now for convenience but I will remove them when this is OK'd.
How to test:
See https://github.com/cryostatio/cryostat/pull/1361