Sun has recently announced GlassFish Enterprise Manager as part of the Sun GlassFish Portfolio. Performance Advisor is one of the key value-added features for the GlassFish Enterprise Manager. Performance Advisor allows you to monitor various aspects of your runtime environment and sends email notifications or takes corrective action when pre-defined thresholds are exceeded.
I had the great priviledge of working on the design and implementation of the UI for this feature. In this blog I would like to discuss how you can manage the Performance Advisor using the administration console. If you would like to learn more about the details or properties of the run-time alerts, please visit the Performance Advisor - VM Alerts blog. The UI for all the Performance Advisor rules are similar and therefore the following examples apply to all of them.
Below are the following Performance Advisor actions supported in the Administration Console:
Viewing Performance Advisor Rules
In order to view all
available Performance Advsior rules select Performance
Advisors
from the tree menu and browse to Management
Rules.
Here you will find a list of all rules that you can add or edit. The Edit
column provides you with a summary of
the rule instances and their targets for each Performance Advisor rule. The View
Advisor Logs
button will launch the Log Viewer and display the Performance Advisor logs. See screenshots below:
Figure 1.1 Performance
Advisor Summary Rules

Figure 1.2 Performance
Advisor Logs
Editing
Performance Advisor Rule(s)
In
order to modify an existing
rule you can click on the rule name from the rules summary table(figure 1.1) which will display a summary table
with a list of all instances of the rule and their targets and property
values. You can then select Edit
Rule
in the Action
Column(see
figure 1.4). On the rule instance summary table
you can also select the appropriate rule instance(s) and perform the
following actions Remove,
Enable
or Disable.
If you would like to
edit the properties only you can also click on the link in the Edit
column from the rules summary page(see figure 1.1) and go to
the editing page directly. Here you can modify the
values and click Save
in order for the values to be updated.
Please note, you cannot change the target of this rule
instance.

Figure 1.3 Performance
Advisor Edit Page

Figure 1.4 Performance
Advisor Rule Instance Table
Adding
Performance Advisor Rule
In order to add a rule(i.e.Memory Leak, Physical Memory Alert, etc.) you will need to select the rule from the Advisor Rules summary page(see figure 1.1) and click on the Add button on the summary rule instance table(see figure 1.4). You will be presented with a page similar to the edit page, however the add page contains default values and a section which allows you to select targets for this rule instance. Once the rule is created you cannot change the target associated with this rule. See screenshot below.

Figure 1.5 Performance
Advisor Add Rule Page
Configuring Email Notifications
You
can configure email
notifications when a pre-defined threshold is reached for the
following six alert rules which include: Physical
Memory Alert, Memory Leak Alert, CPU Usage Trend Alert, Throughput
Alert, GC Pause Time Alert, Log Entry Alert. The email settings UI is
exactly the same for all six alerts. When adding or editing
the rule instance you will be presented with a checkbox which allows
you to enable or disable this feature. By enabling Email
Notifications you will need to provide additional properties necessary
to send and receive these email alert notifications. Please refer
to documentation or in-line help for a description of these properties.
If you later decide to disable the email notification feature
all the property values for the email notifications will be stored and
you can easily enable this feature when desired by selecting the Email
Nofifications checkbox. See screenshot below:

Figure 1.6 Performance
Advisor Add Rule Page