From 60b499820a0e483098871f7cb648cb957a6bd571 Mon Sep 17 00:00:00 2001 From: SpencerA Date: Tue, 5 Aug 2014 13:14:29 -0700 Subject: [PATCH] remote process management updates in h2o-perf --- h2o-perf/bench/py/h2oPerf/H2O.py | 20 +++++++++---------- h2o-perf/bench/py/h2oPerf/Scrape.py | 30 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/h2o-perf/bench/py/h2oPerf/H2O.py b/h2o-perf/bench/py/h2oPerf/H2O.py index c1889cab52..62537ca3c0 100644 --- a/h2o-perf/bench/py/h2oPerf/H2O.py +++ b/h2o-perf/bench/py/h2oPerf/H2O.py @@ -186,22 +186,22 @@ def get_ticks(self): if m != 0: print "DEBUG: Restarting serve_proc!" print "Stopping service" - cmd_serve = "ps -efww | grep 0xdiag | awk '{print %2}' | xargs kill" - tryKill = self.open_channel() - tryKill.exec_command(cmd_serve) + # cmd_serve = "ps -efww | grep 0xdiag | awk '{print %2}' | xargs kill" + # tryKill = self.open_channel() + # tryKill.exec_command(cmd_serve) print "Starting service" - cmd_serve = ["python", "/home/0xdiag/serve_proc.py"] - self.channelServe = self.open_channel() - self.channelServe.exec_command(' '.join(cmd_serve)) + # cmd_serve = ["python", "/home/0xdiag/serve_proc.py"] + # self.channelServe = self.open_channel() + # self.channelServe.exec_command(' '.join(cmd_serve)) r_sys = "" r_proc = "" print "Performing try : " + str(m) + " out of total tries = " + str(max_retries) url_sys = "http://{}:{}/stat".format(self.ip, 8000) url_proc = "http://{}:{}/{}/stat".format(self.ip, 8000, self.pid) try: - r_sys = requests.get(url_sys, timeout=10).text.split('\n')[0] - r_proc = requests.get(url_proc, timeout=10).text.strip().split() + r_sys = requests.get(url_sys, timeout=5).text.split('\n')[0] + r_proc = requests.get(url_proc, timeout=5).text.strip().split() except: m += 1 continue # usually timeout, but just catch all and continue, error out downstream. @@ -229,8 +229,8 @@ def get_ticks(self): url_sys = "http://{}:{}/stat".format(self.ip, 8000) url_proc = "http://{}:{}/{}/stat".format(self.ip, 8000, self.pid) - r_sys = requests.get(url_sys, timeout=120).text.split('\n')[0] - r_proc = requests.get(url_proc, timeout=120).text.strip().split() + r_sys = requests.get(url_sys, timeout=10).text.split('\n')[0] + r_proc = requests.get(url_proc, timeout=10).text.strip().split() sys_user = int(r_sys.split()[1]) sys_nice = int(r_sys.split()[2]) diff --git a/h2o-perf/bench/py/h2oPerf/Scrape.py b/h2o-perf/bench/py/h2oPerf/Scrape.py index 6333e7e52b..1c4a7be7ea 100644 --- a/h2o-perf/bench/py/h2oPerf/Scrape.py +++ b/h2o-perf/bench/py/h2oPerf/Scrape.py @@ -311,21 +311,21 @@ def invoke(self): """ self.insert_phase_result() predict_type = "" - with open(self.output_file_name, "r") as f: - flag = False - for line in f: - if flag: - print "---------------------------------" - print line - print "---------------------------------" - predict_type = self.__get_predict_type__(line.strip())[0] - flag = False - break - if "PREDICT TYPE" in line and "print" not in line: - flag = True - self.result_type = predict_type - print "GOT RESULT TYPE: " + predict_type - self.__switch__() + # with open(self.output_file_name, "r") as f: + # flag = False + # for line in f: + # if flag: + # print "---------------------------------" + # print line + # print "---------------------------------" + # predict_type = self.__get_predict_type__(line.strip())[0] + # flag = False + # break + # if "PREDICT TYPE" in line and "print" not in line: + # flag = True + # self.result_type = predict_type + # print "GOT RESULT TYPE: " + predict_type + # self.__switch__() return None def insert_phase_result(self):