Author:   Lars Michelsen <[email protected]>
Date:     Tue Oct 16 17:19:06 2012 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Tue Oct 16 17:19:06 2012 +0200

Improved object refreshing code to take always the oldest objects first

---

 ChangeLog                               |    1 +
 share/frontend/nagvis-js/js/frontend.js |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4342ce2..95564d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ Core:
   * Bugfix: Fixed parent processing in automap
 
 Frontend:
+  * Improved object refreshing code to take always the oldest objects first
   * Bugfix: Fixed broken rotation links on overview page
   * Bugfix: Zoom code: Catching not handleable font-size declarations
   * Bugfix: Fixed bandwidth calculations for bandwidth weathermap lines
diff --git a/share/frontend/nagvis-js/js/frontend.js 
b/share/frontend/nagvis-js/js/frontend.js
index 3e931ee..ac9d9be 100644
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -298,6 +298,12 @@ function getObjectsToUpdate() {
     // timeslot
     if(arrReturn.length > iNumObjectsPerTimeslot) {
         eventlog("worker", "debug", "Spreading map objects in timeslots");
+
+        // Sort the objects by age and get the oldest objects first
+        arrReturn.sort(function(id_1, id_2) {
+            return oMapObjects[id_1].lastUpdate > oMapObjects[id_2].lastUpdate;
+        });
+
         // Just remove all elements from the end of the array
         arrReturn = arrReturn.slice(0, iNumObjectsPerTimeslot);
     }


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to