Menu

Jamon on Websphere

Mike Guo
2016-04-14
2016-04-14
  • Mike Guo

    Mike Guo - 2016-04-14

    Hi Steve

    It's been a year and I am still a loyal Jamon user. Awesome product. I personally use it as my best performance mornitoring tool and install it for my dev enivronment with Tomcat, also Jboss and Websphere etc. Throughout the time accumulatively I have several questions about Jamon so list them here thanks in advance to enlighten me and hope the question can benefit others too :)

    My first question is about Websphere deployment. Right now I have succesfully deploy Jamon.war and jamon.jar in websphere server:

    1. Jamon.war is deployed as J2EE web application
    2. Jamon.jar is deployed as isolated shared library along with jdbc.jar
    3. Proper configure of the jdbc url in the properties file (add jamon: and appends the require string)

    Works very well for single application. My questions are:

    1. How to make jamon available to multiple applications at same time and jamon.war can show monitering information seperately. Currently, as jamon.jar is isolated deployed, meaning all applications deployed on WAS including jamon.war, refer to the same instance of jamon.jar . So if more than one application configured with jamon, jamon war showing logging with mixed information from multiple application. Any method in Jamon that can differentiate the belonging application from the logging( like filter or something)? Or even better, is there anyway to configure Jamon to become per application monitoring tool?
    2. Jamon.war can list 1000 lines of (SQL) monitering information, however how to generate the full log which beyond 1000 lines (i.e output to a central log file with all history or even better, output to different log files by different applications, so that we can have all necessary performance logging so we can take a look anytime)
    3. How to change the timestamp format? Right now I can see the time stamp is like "4/14/16 1:02:28 PM", but in log4j it is like "2016-04-14 13:02:24,044" which include the millionsecond, how to configure Jamon to show up timestamp with millionseconds as well?

    Thanks again for the great product !

     
  • Steve Souza

    Steve Souza - 2016-04-14

    Thanks for the kind words.

    1. How to make jamon available to multiple applications at same time ...

    If you deploy jamon.jar to each application and also deploy jamon.war to each application they would be seperate.

    1. Jamon.war can list 1000 lines of (SQL) monitering information, however how to ..

    I don't understand this question.

    On a related note. One thing I wanted to ask though. Have you ever played with adding 'value' listeners, or 'max' listeners? This gives you greater control over the sql buffers. Sql Buffer has been replaced by this approach. Well not replaced. They both exist. But listeners are the new improved way.

    1. How to change the timestamp format?...

    What date are you referring to? The data in the Monitor.toString() method? Or the dates that show up in jamonadmin.jsp? Or both?

    Steve

     

    Last edit: Steve Souza 2016-04-14
    • Mike Guo

      Mike Guo - 2016-04-14

      Thanks for the speedy reply Steve!

      1. in websphere, jamon war has to deploy as a j2ee web applicaion otherwise not sure how to work out the root context..

      2. I rarely place any code for the monitoring, but only change the properties and add jamon.jar as dependency. What am saying on localhost:8080/jamon/sql.jsp there is an option that can list 1000 rows at most, I wonder if there is any other method that can list / output the full log (all rows)

      3. Based on 2. It's for the date on jamonadmin.jsp or sql.jsp
       
      • Steve Souza

        Steve Souza - 2016-04-14

        Follow comments below. The following may not be clear, but I should be able to step you through a few changes. The changes i mention below involve a few simple problems to sql.jsp and jamonadmin.jsp. I can further elaborate in any followup questions you may have.

        in websphere, jamon war has to deploy as a j2ee web applicaion otherwise not sure how to work out the root context..
        Hmm. I'm not sure then. What about jboss and tomcat? Can the other apps contain more than 1 war? i.e. I think EARs used to be able to do that...

        I rarely place any code for the monitoring, but only change the properties and add jamon.jar as dependency. What am saying on localhost:8080/jamon/sql.jsp there is an option that can list 1000 rows at most, I wonder if there is any other method that can list / output the full log (all rows)

        I don't have jamon.war running on my computer right now. Are you saying that it only allows for 1000 entries at most? How many would you like it to have? You wouldn't want it unlimited due to memory concerns. I think there is nothing limiting it to 1000, except the hardcoded values in sql.jsp.

        You could try to manually submit a bigger value and it should work (as part of the url or form request). Here is where it gets this value: https://github.com/stevensouza/jamonapi/blob/master/jamon_war/src/main/webapp/sql.jsp#L15

        (note the jamon repo is both on sourceforge and github hence the above link).
        Or...

        Here is where the values in the select box are populated. You could just add bigger ones: https://github.com/stevensouza/jamonapi/blob/master/jamon_war/src/main/webapp/sql.jsp#L15

        Unfortunately you would have to change it here too (hey it's old ugly code!): https://github.com/stevensouza/jamonapi/blob/master/jamon_war/src/main/webapp/sql.jsp#L238

        Based on 2. It's for the date on jamonadmin.jsp or sql.jsp
        "4/14/16 1:02:28 PM", but in log4j it is like "2016-04-14 13:02:24,044"

        You should be able to change the DateFormatter here to anything you want. There is a similar place in jamonadmin.jsp I would guess.
        https://github.com/stevensouza/jamonapi/blob/master/jamon_war/src/main/webapp/sql.jsp#L272

        Currently it gets the default date formatter. You should be able to create a data formatter that returns it in the log4j formatter instead.

         

        Last edit: Steve Souza 2016-04-14
        • Mike Guo

          Mike Guo - 2016-04-14

          Thanks Steve, i don't mind of manual change, however I wonder if there is anyway to output the full monitoring history to a file or page, so later I can retrospect.

          i.e. If I have a long term process that will keep running for 15 mins and I would like to check the performance in the middle of the process but don't want to make any code change. Currently I have to click "Go" or refresh until the certain point to collect the information, instead of I can go to a folder find a log file with everything for the 15 mins. I know if we add this feature into the application it will also cost performance, but just saying if jamon.war can do something as independent application so it won't cause any performance burden and will leave a full trace. Maybe such function already exist just I am not awared of.

          I will try the date format :)

           
          • Steve Souza

            Steve Souza - 2016-04-14

            Outputting to a page or keeping the full history (in memory) could cause memory problems if it is allowed to grow very large or unbounded. jamon.war doesn't really keep any state for jamon. All the state is kept in the shared jamon.jar so if you increase the buffer it increases memory used by jamon.

            Probably a better approach is to write a jamon listener that logs all the sql. That way the information is not kept in memory. This should be pretty easy to do. I can help you with that if you are interested.

            Here is the interface and you can get the sql details from the key of the monitor that is passed into processEvent(Monitor mon) https://github.com/stevensouza/jamonapi/blob/master/jamon/src/main/java/com/jamonapi/JAMonListener.java

            Any jamonListeners are registered via https://github.com/stevensouza/jamonapi/blob/master/jamon/src/main/java/com/jamonapi/JAMonListenerFactory.java

            For more on jamon listeners look at http://jamonapi.sourceforge.net/jamonlisteners.html

             
            • Mike Guo

              Mike Guo - 2016-04-14

              I guess listener is the way to go then. Let me read it through (may take sometime) and get back to you.

              may be an independent library, will see.

              Thanks Steve !

               
              • Steve Souza

                Steve Souza - 2016-04-14

                It should be very simple. I suggest first coding a simple JAMonListener that does something simple like the following in the processEvent: System.out.println("myjamonlistener is being called!!!!!");

                The steps are

                1. Implement JAMonListener
                2. Register this listener into JAMonListenerFactory.put(JAMonListener jamonListener) https://github.com/stevensouza/jamonapi/blob/master/jamon/src/main/java/com/jamonapi/JAMonListenerFactory.java#L84
                3. The listener will now show up when you manage the monitor from the jamon.war (managemon.jsp i believe or something like it). You can select it and attach it to a monitor. After doing this your JAMonListener will be called.
                 
  • Steve Souza

    Steve Souza - 2016-04-14

    By the way I have another open source product called Automon that you might find useful. It uses jamon behind the scenese (or any monitoring tool of your choice), but it allows you to monitor any methods whether you own the code or not. All done declaritively. Simlar to monitoring Spring beans with jamon except it is more flexible in that it doesn't just manage spring beans, and not just code that you own... www.automon.org

     

    Last edit: Steve Souza 2016-04-14
    • Mike Guo

      Mike Guo - 2016-04-14

      Didn't know that, thanks for the recommendation! I think it is good stuff, just send a small donation to appreicate the creativity and nice support !

       
      • Steve Souza

        Steve Souza - 2016-04-14

        Thanks. I am not even sure how I collect my donation! I guess I will have to look into that. It is appreciated as I cover all costs associated with jamon.

         
        • Mike Guo

          Mike Guo - 2016-04-14

          LOL it goes to paypal, probably you already a millionare haha. I really admire your creativity and the spirit of developing opensource / freeware.

           
      • Steve Souza

        Steve Souza - 2016-04-14

        I haven't used this paypal account in ages. Not sure if the link is busted or not but they say nothing showe up in the account.

         
      • Steve Souza

        Steve Souza - 2016-04-14

        I haven't used this paypal account in ages. Not sure if the link is busted or not but they say nothing showe up in the account.

         

Log in to post a comment.

MongoDB Logo MongoDB