Monitoring Your Application


The most important thing in the server is your application, so we'll start our tour of JBoss's management and monitoring capabilities by looking at what JBoss can tell you about the state of currently running applications.

How do I do that?

If you drill down into the J2EE Domains section, you'll find an entry for the currently running JBoss instance. Inside that you'll find all the application packages deployed in the server: EAR files, WAR files, EJB jar files, and JBoss SAR (service archive) files. For deployments that are nested, such as with an EAR file, you can expand the parent archive to see the internal applications.

If the ToDo application is still deployed, you should find todo.ear near the top of the list. Selecting todo.ear will display some basic deployment information, including the application.xml deployment descriptor, in the details section on the right.

An EAR file is really just a container for other deployments, so there isn't much to see here. What you'll want to see are the contents of the EAR file. When you expand todo.ear, you'll see the two primary application components: todo.jar and todo.war.

Selecting either of these will show deployment information for the archive, just as you saw for the EAR file. Even better, expanding either of these archives will show all the EJBs or servlets provided by that application. Figure 8-2 shows the view of the TaskMaster bean.

Developer's Notebook 8-2. EJB statistics provided by the Web Console


The Bean Statistics section shows the status of the bean pool. JBoss currently has six instances of the TaskMaster bean waiting to serve requests. CreateCount shows the number of times a TaskMaster bean has been created, meaning an object was taken from the bean pool and made ready to service client requests.

Below that are the bean's invocation statistics. For each bean method, the total number of invocations processed is recorded, along with the minimum, maximum, and average processing time. You can see that, on average, it takes 145ms to create a new task, but 301ms to load all the tasks for a user. That load time seems a bit high, but it is actually skewed somewhat by the initial loading of data from the database. Once JBoss has cached the data, load times trend toward the minimum access time. You can verify this by resetting the statistics, using the Reset Stats link, and accessing the application again.

You can find similar processing statistics for a servlet by selecting a servlet under todo.war. The ToDo application doesn't use servlets extensively. The only interesting servlet is FacesServlet, which processes JavaServer Faces requests. If you select it, you will see the minimum, maximum, and average response times for the servlet, as well as an invocation count.


Note: If you are a J2EE guru, you might recognize this as the JSR-77 J2EE Management data.

What just happened?

You saw how to get basic usage statistics out of the server, down to the bean and servlet level. The available information isn't exhaustive, but it will help you locate performance problems for further investigation.



JBoss. A Developer's Notebook
JBoss: A Developers Notebook
ISBN: 0596100078
EAN: 2147483647
Year: 2003
Pages: 106

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net