Published in:

Blog

·

·

Alert via email on used heap percentile threshold

·

This custom function obtains the used heap statistics, particularly useful in cases where you wish to log or be notified of potential performance issues. In order to get the used heap statisticspercentage you will need to use the custom functionGetHeapUsageInPercentile. Refer the downloads section to use this function.

Downloads

Source code and build instructions

SeeHow to Create Custom Trigger Functionsfor details on installation.

How to alert via email on used heap percentile threshold

Let me now show you how to implement that.

Before creating a custom trigger you need to havebuildinstalled in theserver.

1. Create a trigger to get the statistics of available heap

Login into admin console of JSCAPE MFT Server > Triggers and ClickAddto create a Trigger

Give the trigger aNameand then select the Current Timeevent type from the drop-down list.

alert_via_email_heap_usage_threshold_img1

ClickNextto Step 2 where a condition can be set to execute the trigger.

Consider an example that the server is too slow in responding, one of the reason for the slowness is much heap usage. In order to identify on what time the server is slow and when the heap usage is too high, the below mentioned expression can be used where the server checks for the used heap in percentile for ever 30 minutes in a day.

(Minute=0 OR Minute=30) AND (GetHeapUsageInPercentile() > 80)

The above expression indicates to send an email when 80 % of the heap is used.

alert_via_email_heap_usage_threshold_img2

Once the condition is set ClickNextto proceed

On Step 3 an action has to be added, in order to add an action clickAddbutton and select the action “Send Email” from drop down list and Click OK

is_server_key_valid_img4

On OK to add and input the required parameters.

is_server_key_valid_img5

Enter all necessary parameters for sending that email notification, including the hostname of your SMTP server, the port number, connection type, etc.In theBodytext box, enter the message you want to relay.

In theBodytext box , apart from the custom message we can add the function GetHeapUsageInPercentile()to print the value of the free heap in percentage so the recipients will aware of the status of the heap

ClickOkto save the settings.

That’s it. Now you know how to use to send email on more heap usage.

Downloads

Download JSCAPE MFT Server

Latest Articles