0% found this document useful (0 votes)
119 views

Opensource Framework: Javamelody

Java Melody is an open source tool for monitoring Java application performance. It provides statistics on memory usage, HTTP requests, active threads, database connections and errors. It displays this information through graphical charts and allows monitoring performance over time to improve applications. Java Melody integrates with applications by adding a filter and dependency and provides a monitoring page for viewing statistics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views

Opensource Framework: Javamelody

Java Melody is an open source tool for monitoring Java application performance. It provides statistics on memory usage, HTTP requests, active threads, database connections and errors. It displays this information through graphical charts and allows monitoring performance over time to improve applications. Java Melody integrates with applications by adding a filter and dependency and provides a monitoring page for viewing statistics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

10/27/21, 11:32 PM JavaMelody

OpenSource Framework

JavaMelody
-
May 06, 2020

What is Java Melody

Java Melody is an open source application to


monitoring java application server.
It is light weight and loose coupling (i.e. with
minimal jar file and without
application dependency we can add/remove javamelody monitoring).
It is a measuring tool for calculate statistic
operation of an application depending
on the usages of an application.

Why Java Melody 

As it is a monitoring tool, it is used for


monitoring your application and checking
application performance.
It is used for monitoring below details of an application:

1. Memory
utilizes
2. Http
request per minute
3. Active
thread
4. Active
JDBC connection
5. Used
JDBC connection
6. Percentage
of Http errors
7. Percentage
of sql errors and etc.

All monitoring window will display the usages of


above session in a graphical
format.
We can monitor the graph based on
day/week/month/year/by date range         

 Where it is used

It is used in QA and production environment for


measuring application
performance.
It allows to improve the application by calculating
below mention factors:
Memory use, http session, active JDBC connection,
used JDBC connection, http
request per minute, sql hit per minute, percentage
of http & sql error
https://opensourcefw.blogspot.com/2020/05/javamelody.html 1/6
10/27/21, 11:32 PM JavaMelody

 Java Melody Plugins

As it is light weight we can able to track our


application performance by adding
only one plugin that is net.bull.javamelody .
 Java Melody Setup

Filter configuration in web.xml


pom.xml dependency
simple java program

 Java Melody Example using Servlet & maven

 Project directory structure:

    

pom.xml

        <dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.25.0</version>
</dependency>

web.xml

       <filter>
              <filter-name>monitoring</filter-name>
              <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
        </filter>
        <filter-mapping>
https://opensourcefw.blogspot.com/2020/05/javamelody.html 2/6
10/27/21, 11:32 PM JavaMelody

            <filter-name>monitoring</filter-name>


            <url-pattern>/*</url-pattern>
        </filter-mapping>

        <servlet>
      <servlet-name>melodytest</servlet-name>
      <servlet-class>com.os.javamelody.JavaMelodyTest</servlet-class>
        </servlet>
        <servlet-mapping>
      <servlet-name>melodytest</servlet-name>
      <url-pattern>/test</url-pattern>
        </servlet-mapping>

JavaMelodyTest.java
package com.os.javamelody;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class JavaMelodyTest extends HttpServlet {
private static final long serialVersionUID = 1L;    
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().append("Welcome to home page");
}
}

Application execution process:

Start your application server


Type http://localhost:8080/JavaMelody/test
Type http://localhost:8080/JavaMelody/monitoring

    

https://opensourcefw.blogspot.com/2020/05/javamelody.html 3/6
10/27/21, 11:32 PM JavaMelody

Explanation of Java Melody Charts

It is a graphical chart we can check report based


on day/week/month/year/by
date range.
for monitoring individual chart you can click on the chart for zoom view.

https://opensourcefw.blogspot.com/2020/05/javamelody.html 4/6
10/27/21, 11:32 PM JavaMelody

How to disable Java Melody from your application

Remove filter from web.xml

        <filter>
              <filter-name>monitoring</filter-name>
              <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>monitoring</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

Remove dependency from pom.xml

        <dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.25.0</version>
</dependency>

Enter your comment...

Popular posts from this blog

SQL Error: 17410 : No more data to read from socket


-
May 24, 2020

No more data to read from socket [SQL Error: 17410, SQLState: 08000]      Hello readers
welcome you to my blog Today during regression testing we faced one of the interesting
https://opensourcefw.blogspot.com/2020/05/javamelody.html 5/6
10/27/21, 11:32 PM JavaMelody
welcome you to my blog.      Today during regression testing we faced one of the interesting
issues which is not able to read data from socket .      Let’s go discuss more details about the …

READ MORE

HP Fortify Scanner
-
October 24, 2019

About HP Fortify scan:                HP Fortify Scanner is a application security


vulnerability software provided by HP Company.It is used to find the security
vulnerabilities in software code. List of issues: SQL injection Unrelease …

READ MORE


Powered by Blogger

Theme images by Michael Elkan

OPENSOURCE FRAMEWORK

Working in CMML5 IT company.

VISIT PROFILE

Archive

Report Abuse

https://opensourcefw.blogspot.com/2020/05/javamelody.html 6/6

You might also like