The .dataset
property must be used to access it.
Looking into the html code of the website, the corresponding data field can be found. E.g. for the Free Heap value:
<div data-source="lightstreamer" data-grid="stats" data-item="monitor_statistics" data-field="MEMORY.FREE" class="lscold">19,670,080</div>
So the corresponding dataset field is MEMORY.FREE. Reading that, the updated value of Free Heap is read:
// Create a MutationObserver to handle events
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(typeof mutation.target.dataset !== 'undefined') {
if(mutation.target.dataset.field === 'MEMORY.FREE') {
console.log("mutation.target.textContent: " + mutation.target.textContent);
}
}
});
});
Resulting Console log:
mutation.target.textContent: 18,470,424
mutation.target.textContent: 34,835,560
mutation.target.textContent: 34,835,560
mutation.target.textContent: 31,032,000