Exemplo n.º 1
0
    def prepare_run(self, run_info):
        # Adjust rate according to ratio, if enabled
        run_info = copy.deepcopy(run_info)
        if self.enable_ratio and run_info["ratio"]:
            run_info["rate"] = run_info["rate"] * run_info["ratio"] / 100

        self.samples = []
        self.run_info = run_info
        self.run_error = False
        self.run_result = None
        self.reply.clear()

        interface.send_node(self.socket, interface.PREPARE_RUN, dests=self.get_dests(), run_info=run_info)
Exemplo n.º 2
0
    def prepare_run(self, run_info):
        # Adjust rate according to ratio, if enabled
        run_info = copy.deepcopy(run_info)
        if self.enable_ratio and run_info['ratio']:
            run_info['rate'] = run_info['rate'] * run_info['ratio']/100

        if not self.sources and not self.dests:
            # Tell helpers that they are helpers
            run_info['role'] = 'helper'
        elif not self.sources and self.dests:
            run_info['role'] = 'source'
        elif self.sources and not self.dests:
            run_info['role'] = 'destination'

        self.samples = []
        self.run_info = run_info
        self.run_error = False
        self.run_result = None
        self.total_cpu = None
        self.total_idle = None
        self.reply.clear()

        interface.send_node(self.socket, interface.PREPARE_RUN, dests=self.get_dests(), run_info=run_info)
Exemplo n.º 3
0
 def finish_run(self):
     self.store_samples = False
     self.reply.clear()
     interface.send_node(self.socket, interface.FINISH_RUN)
Exemplo n.º 4
0
 def start_run(self):
     self.reply.clear()
     interface.send_node(self.socket, interface.START_RUN)
     self.store_samples = True
Exemplo n.º 5
0
 def finish_run(self):
     self.reply.clear()
     interface.send_node(self.socket, interface.FINISH_RUN)