WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 04:11 PM

    Hello,

    I am trying to gather performance statistics on WAS 9 using JMX. Currently, I am just testing using JConsole. I have been able to get a majority of the mbeans to show up, however, I am having trouble w/ the PerfMBean to give me performance metrics.

    When I am connected via JConsole, I will select an mbean, for example "SystemMetrics". I will then navigate down until I hit "Operations" and click "getStats()". However, when I click it, I get an error that says "Problem invoking getStats: java.lang.NoClassDefFoundError: javax/management/j2ee/statistics/Stats"

    Any help on why this is happening would be great. I've been able to gather a lot of configuration information, but not a lot on performance. I have also noticed that the Attribute "stats" is currently "false". Perhaps, I need to enable that first. Any tips on how to do that would be great as well.



    ------------------------------
    Cameron Jones
    ------------------------------



  • 2.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 04:27 PM
    Hi,

    I would suggest you like at enabling some PMI metrics.

    Hint : Have a look at the metrics app (based on prometheus and Grafana)

    Hope it helps

    Best regards, 
    --------------------------------------------------------------
    Walid Largou
    Solution Architect / Service Delivery Manager
    Mobile : +212 621 31 98 71
    Email : l.walid@powerm.ma
    320 Bd Zertouni 6th Floor, Casablanca, Morocco
    --------------------------------------------------------------
    https://www.powerm.ma
    Power Maroc #1 IBM Business Partner – Power Maroc
    This message is confidential .Its contents do not constitute a commitment by Power Maroc S.A.R.L except where provided for in a written agreement between you and Power Maroc S.A.R.L. Any authorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately.





  • 3.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 04:36 PM

    Hello Walid,

    Thanks for the advice. I had been looking at the documentation for that integration but perhaps I am missing something?

    If I go to Performance Monitoring Infrastructure (PMI) under "Monitoring and Tuning" and select my Application Server I have "All" selected both under the Configuration and Runtime tab. Do I need to do something else to enable this?

    I saw on the documentation (https://www.ibm.com/docs/en/was/9.0.5?topic=mosh-displaying-pmi-metrics-in-prometheus-format-metrics-app) it does say to avoid using "All". Is it possible that having it set to "All" is preventing metrics from sending at all?



    ------------------------------
    Cam
    ------------------------------



  • 4.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 04:45 PM
      |   view attached
    Hi,

    It could be also a version problem (i have seen some apar like this before), what versions are you using ?








  • 5.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 04:51 PM

    I am currently using 9.0.5.12



    ------------------------------
    Cam
    ------------------------------



  • 6.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 05:09 PM
      |   view attached
    Hi,

    I see, the error you get generally means a missing dependency(jar), but since it's the jconsole app it's not relevant i guess. Are you planning to develop a custom app to go through the metrics afterwards ?

    Hope it helps






  • 7.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 05:24 PM

    Yeah that is the plan. I have been using JConsole to understand what the JMX call will look like, and then make the calls in the Application. This has generally worked for everything except the "getStats()" calls.

    Unfortunetly, I am working through a framework that works best if I can give it a single JMX call that gathers everything I need which is why I was attempting to use the getStats() over what I've seen on pages like this: https://www.ibm.com/docs/en/was/9.0.5?topic=dyoma-using-jmx-interface-develop-your-own-monitoring-application

    There is a way to do a custom-code where I could implement something like that page suggests, though, so maybe I will attempt that next. However, my concern is that I will run into the same issue where I am unable to gather statistics because I get that same error.

    I am not seeing anything in the WAS logs, but do you know if there is a specific place that PMI logs would be? Perhaps I could find some sort of error message that helps me understand why this is happening.



    ------------------------------
    Cam
    ------------------------------



  • 8.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 05:30 PM

    jconsole uses java SE classes unless you configure the classpath otherwise,  but javax/management/j2ee/statistics/Stats is a java EE class returned by the SystemMetrics mbean, see the javadoc for SystemMetrics here.  Try adding <WAS_HOME>/lib/webadmin/management.jar to your classpath when invoking jconsole.



    ------------------------------
    FRED ROWE
    ------------------------------



  • 9.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 05:33 PM
      |   view attached
    Hi,

    As Fred suggested, the problem is more on the client side (jconsole in your case), that's why you can't see error on websphere.

    Note : somehow similar with jboss and custom code ( 

    Hope it helps






  • 10.  RE: WAS 9 JMX - How to get Performance Statistics?

    Posted Tue March 07, 2023 05:48 PM

    That was it! I was missing management.jar in my classpath. getStats() is now working.

    Thank you @FRED ROWE and @Largou walid



    ------------------------------
    Cam
    ------------------------------