Difference between revisions of "Script Reset Threads"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
(Created page with " 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.entryS...")
 
 
Line 1: Line 1:
 
  var cm = actions.ros.getClass().getDeclaredField("servers");
 
  var cm = actions.ros.getClass().getDeclaredField("servers");
cm.setAccessible(true);
+
cm.setAccessible(true);
log.warn(cm)
+
log.warn(cm)
  var value = cm.get(actions.ros);
+
var value = cm.get(actions.ros);
log.warn(value)
+
log.warn(value)
log.warn(value.entrySet())
+
log.warn(value.entrySet())
//for (var server in value.keys()){
+
var a = value.keySet().toArray()
//log.warn(server)
+
for (var i = 0; i < a.length; i++) {
//}
+
     var processors = value.get(a[i]).getProcessorssv5();
var a = value.keySet().toArray()
+
    //log.warn(processors);
for(var i=0;i<a.length;i++) {
+
     if (processors != null) {
    //log.warn(a[i]);
+
        for (var p = 0; p < processors.length; p++) {
  //log.warn(value.get(a[i]))
+
            var theThread = processors[p]
     var processors=value.get(a[i]).getProcessorssv9();
+
            //log.warn(p+" "+theThread);
  //log.warn(processors);
+
            if (theThread !== null) {
     for(var p=0;p<processors.length;p++) {
+
                var allowed = theThread.allowedReceivedPackets;
      var theThread = processors[p]
+
                if (theThread.receivedPackets.size() >= allowed) {
      //log.warn(p+" "+theThread);
+
                    log.warn("receivedPackets too big");
      if (theThread!==null){
+
                    log.warn(p + " " + theThread.receivedPackets.size() + " " + theThread.allowedReceivedPackets + " " + theThread.created);
        var allowed=theThread.allowedReceivedPackets;
+
                    processors[p] = null;
        allowed=1;
+
                    theThread.stop()
              if (theThread.receivedPackets.size()>=allowed){
+
                }
        log.warn("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()
 +
                }
 +
            }
 +
        }
 +
    }
 +
}

Latest revision as of 12:22, 8 March 2024

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()
               }
           }
       }
   }

}