示例#1
0
        info = self.domuid + " " + str(heart_rate) + " hr " + time_now + "\n"
        info += self.domuid + " " + str(
            cur_bw /
            self.timeslice_us) + " cpu1 cpu2 cpu3 cpu4 cpu5 " + time_now + "\n"
        with open("info.txt", "a") as myfile:
            myfile.write(info + "\n")

        return

    # https://xenbits.xen.org/docs/unstable/man/xl.1.html#SCHEDULER-SUBCOMMANDS
    # cpupool, vcpupin, rtds-budget,period, extratime, vcpu-list


threadLock = threading.Lock()
threads = []
shared_data = xen_interface.get_global_info()

xen_interface.sched_credit(args["CreditdomUs"],
                           timeslice_us * args["static_alloc"] / 100)
xen_interface.sched_credit(args["CreditdomUs_Dummy"],
                           timeslice_us * (1 - args["static_alloc"] / 100))
xen_interface.sched_rtds(args["RTdomUs"], timeslice_us,
                         timeslice_us * args["static_alloc"] / 100, [])
xen_interface.sched_rtds(args["RTdomUs_Dummy"], timeslice_us,
                         timeslice_us * (1 - args["static_alloc"] / 100), [])

# if '1' in shared_data['rtxen']:
# 	xen_interface.sched_rtds(1,timeslice_us,default_bw,[])
# 	xen_interface.sched_rtds(2,timeslice_us,timeslice_us-default_bw,[])
# if '1' in shared_data['xen']:
# 	xen_interface.sched_credit(1,default_bw)
示例#2
0
        time_now = str(time.time())
        info = self.domuid + " " + str(heart_rate) + " hr " + time_now + "\n"
        place_holder_for_graph = " x x x x x "
        info += self.domuid + " " + str(
            cur_bw /
            self.timeslice_us) + place_holder_for_graph + time_now + "\n"
        # info += self.other_domuid+ " "+str(other_cur_bw/self.timeslice_us) + place_holder_for_graph+time_now
        with open("data.txt", "a") as myfile:
            myfile.write(info + "\n")
        return


# initializing data and setup inital cpu assignment
threadLock = threading.Lock()
threads = []
shared_data = xen_interface.get_global_info()
for domuid in monitoring_domU:
    if domuid in shared_data['rtxen']:
        xen_interface.sched_rtds(domuid, timeslice_us,
                                 timeslice_us * args["static_alloc"] / 100, [])
    if domuid in shared_data['credit']:
        xen_interface.sched_credit(domuid, timeslice_us / 2)

# initializing values
shared_data = xen_interface.get_global_info()

pp = pprint.PrettyPrinter(indent=2)
pp.pprint(shared_data)

# stdout ready status to inform user
print('')