Script Reset Threads

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
var cm = actions.ros.getClass().getDeclaredField("servers");

cm.setAccessible(true); log.warn(cm) var value = cm.get(actions.ros); log.warn(value) log.warn(value.entrySet()) var a = value.keySet().toArray() for (var i = 0; i < a.length; i++) {

   var processors = value.get(a[i]).getProcessorssv5();
   //log.warn(processors);
   if (processors != null) {
       for (var p = 0; p < processors.length; p++) {
           var theThread = processors[p]
           //log.warn(p+" "+theThread);
           if (theThread !== null) {
               var allowed = theThread.allowedReceivedPackets;
               if (theThread.receivedPackets.size() >= allowed) {
                   log.warn("receivedPackets too big");
                   log.warn(p + " " + theThread.receivedPackets.size() + " " + theThread.allowedReceivedPackets + " " + theThread.created);
                   processors[p] = null;
                   theThread.stop()
               }
           }
       }
   }

}

for (var i = 0; i < a.length; i++) {

   var processors = value.get(a[i]).getProcessorssv9();
   //log.warn(processors);
   if (processors != null) {
       for (var p = 0; p < processors.length; p++) {
           var theThread = processors[p]
           //log.warn(p+" "+theThread);
           if (theThread !== null) {
               var allowed = theThread.allowedReceivedPackets;
               if (theThread.receivedPackets.size() >= allowed) {
                   log.warn("receivedPackets too big");
                   log.warn(p + " " + theThread.receivedPackets.size() + " " + theThread.allowedReceivedPackets + " " + theThread.created);
                   processors[p] = null;
                   theThread.stop()
               }
           }
       }
   }

}