DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Monitoring GlassFish Application Server's HTTP Service Using VisualVM

Monitoring GlassFish Application Server's HTTP Service Using VisualVM

Masoud Kalali user avatar by
Masoud Kalali
·
Mar. 24, 09 · Interview
Like (0)
Save
Tweet
Share
27.28K Views

Join the DZone community and get the full member experience.

Join For Free
The GlassFish application server has some monitoring features which are exposed through its administration channels including Administration Console and asadmin utility. I disucssed some of these features here and in this we will see how we can use visualvm and its plugin as a desktop application to monitor GlassFish HTTP service.

VisualVM is JDK tool based on NetBeans platform, NetBeans profiler, and a handful of plug-ins which let us profile any Java application running in JDK 6 or 7. VisualVM does not works with older JDK or any JRE either 6 or 7. Starting from JDK 6 update 7 visualVM is included in the Sun JDK distribution.

Downloading and installing latest version of visualVM is straight forward, just point to Download Page grab the zip file, extract the zip file content and you are ready to go. Follow the installation instruction (4 very easy steps) here

Now, to monitor GlassFish HTTP service we need to install a visualVM plugin that can interact with GlassFish application server through its JMX/ AMX API to gather the statistics and let us view them live in our desktop application. Run visualVM using the provided script in the bin directory, Open Tools>Plugins menu item and from the available plug-ins section select VisualVM-GlassFish and press install button to install the plug-in. Restart VisualVM and now we are ready to connect to a GlassFish instance.


A_figure01.jpeg

Now we have two options, we can either monitor a local Glassfish instance or we can select to monitor a remote Glassfish instance. All local JVM are listed under the local node and in order to create a remote connection we need to register the host under the Remote node by right clicking on the node and adding the remote host, in my case I add 192.168.1.100. Now on the remote host we may have several JXM enabled applications running, each application on its own port. Default JMX port for GlassFish application server is 8686, therefore to add a GlassFish application server running on 192.168.1.100 we can right click on its node under the Remote node and select add JMX connection, a window will open which asks you to provide the connection information including port number and credentials. default administration credentials for GlassFish are admin/ adminadmin as username/ password. A_figure02.jpeg

Now that The remote GlassFish is registered the right side panel should be similar to the fillowing figure

A_figure03.jpeg

In my case I have a remote and a local GlassFish instances, When you double click on an instance a window will open that shows all monitoring information which VisialVM can gather about the running application in different panels, something similar to the following figure

A_figure04.jpeg

This page shows general information about the JVM which we are going to monitor and some of the plug-in specific configuration which we may need to change. Make sure that you turn the HTTP Service monitoring level and WebContainer Monitoring Level to High or LOW which will result in GlassFish gathering monitoring statistics about the HTTP Service.

A_figure05.jpeg

Now let your application server get some hit from the clients and then switch to HTTP Service Tab in order to get a general overview of your Server HTTP Service performance. Failed, Incoming, Average connections, Keep Alive, and File Cache performance can be monitored here. Following Figure shows HTTP Service Tab

A_figure06.jpeg

Now the funny part begins, Assuming that we have a dozen of application hosted in the same GlassFish instance we expect to be able to monitor each application separately to see how HTTP service is performing for that particular application. It is easy and do-able in no more than 3 steps. Under the GlassFish node you can see Model and under the Model you can see different web applications that you have hosted in your server, double clicking on any of those applications result in viewing the HTTP Service statistics for that particular application. For example If I double click on the admingui I will get a result page similar to the next figure.

A_figure07.jpeg

The fun part continues further I tell you that you can monitor different servlets used in your application separately. for example I can expand the admingui node and double click on ThemeServlet to get an statistical view similar to the next figure.

A_figure08.jpeg

All statistical information which are shown includes two major factors, processing time and error/ request count. in addition to average processing time, maximum processing time, and so on.

 

From http://weblogs.java.net/blog/kalali/


 

application GlassFish Application server Web Service

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What Is JavaScript Slice? Practical Examples and Guide
  • Comparing Map.of() and New HashMap() in Java
  • Specification by Example Is Not a Test Framework
  • Distributed Tracing: A Full Guide

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: