jolokia queue monitoring html script (uses jquery)

Just alter the location of jquery to suit:

 

<!doctype html>
<html>
<head>
<script type=”text/javascript” src=”jquery-1.11.1.js“></script>
<style type=”text/css”>
td { border: 1px solid #666; padding:5px; }
table { border-collapse:collapse}
</style>
</head>
<body onload=”javascript:fetch()”>
<h1>Monitoring Queues on Admin Server</h1>
<script type=”text/javascript”>
var index_url = “http://localhost:7001/jolokia-war-1.2.1/read/com.bea:JMSServerRuntime=jms-server-1,Name=jms-module-1!!indexQueue,ServerRuntime=AdminServer,Type=JMSDestinationRuntime/MessagesCurrentCount,MessagesHighCount,MessagesReceivedCount”;
var luc_index_url = “http://localhost:7001/jolokia-war-1.2.1/read/com.bea:JMSServerRuntime=jms-server-1,Name=jms-module-1!!luceneIndexQueue,ServerRuntime=AdminServer,Type=JMSDestinationRuntime/MessagesCurrentCount,MessagesHighCount,MessagesReceivedCount”;
var mine_url = “http://localhost:7001/jolokia-war-1.2.1/read/com.bea:JMSServerRuntime=jms-server-1,Name=jms-module-1!!mineQueue,ServerRuntime=AdminServer,Type=JMSDestinationRuntime/MessagesCurrentCount,MessagesHighCount,MessagesReceivedCount”;

function updateDiv(url, divName) {
$.getJSON( url,
function( data ) {
var mhc = data.value.MessagesCurrentCount;
$(divName).html(mhc);
}
);
}

function fetch() {
updateDiv(index_url, “#indexQueueCount”);
updateDiv(luc_index_url,”#luceneQueueCount”);
updateDiv(mine_url, “#mineQueueCount”);
$(“#lastDate”).html(new Date());
setTimeout(fetch, 2000)
}
</script>
<table>
<tr>
<td>Index Queue Current Message Count</td>
<td id=”indexQueueCount”></td>
</tr>
<tr>
<td>Lucene Queue Current Message Count</td>
<td id=”luceneQueueCount”></td>
</tr>
<tr>
<td>Link Mining Queue Current Message Count</td>
<td id=”mineQueueCount”></td>
</tr>
</table>
<p>
Last fetched: <span id=”lastDate”></span>
</p>
</body>
</html>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s