Пример #1
0
    def run(self):
        global sigint
        high_rate_set = False
        while not sigint:
            is_high, is_low = self.stat.refresh()
            if is_high and not high_rate_set:
                ac = AffinityControl()
                high_rate_set = True
#                ac.add_waypoint(link_name, self.waypoint_address)
                ac.add_isolate(link_name)
                ac.enable_affinity()
                print "Adding isolate affinity to link: %s" % (link_name)
#                time.sleep(3)
            elif is_low and high_rate_set: 
                high_rate_set = False
                ac.remove_isolate(link_name)
                ac.enable_affinity()
                print "Adding isolate affinity to link: %s" % (link_name)
            time.sleep(10)
Пример #2
0
    def run(self):
        global sigint
        high_rate_set = False
        while not sigint:
            is_high, is_low = self.stat.refresh()
            if is_high and not high_rate_set:
                ac = AffinityControl()
                high_rate_set = True
                #                ac.add_waypoint(link_name, self.waypoint_address)
                ac.add_isolate(link_name)
                ac.enable_affinity()
                print "Adding isolate affinity to link: %s" % (link_name)


#                time.sleep(3)
            elif is_low and high_rate_set:
                high_rate_set = False
                ac.remove_isolate(link_name)
                ac.enable_affinity()
                print "Adding isolate affinity to link: %s" % (link_name)
            time.sleep(10)