diff --git a/scripts/graph.py b/scripts/graph.py index d53569b..aca7dbf 100644 --- a/scripts/graph.py +++ b/scripts/graph.py @@ -10,11 +10,11 @@ def plot_graph(x, y, title, x_label, y_label, filename): plt.clf() -def plot_resource_graph(x, y, title, x_label, y_label, filename): - requests = x +def plot_resource_graph(x_data, y_data, title, x_label, y_label, filename): + requests = x_data resource = { - 'CPU': (p[0] for p in y), - 'RAM': (p[1] for p in y), + 'CPU': [p[0] for p in y_data], + 'RAM': [p[1] for p in y_data], } x = np.arange(len(requests)) @@ -68,7 +68,7 @@ def get_resource_data(filename): line = line.strip().split(',') if line: x.append(int(line[0])) # requests - y.append([float(v) for v in line[1:]]) # cpu, ram + y.append([float(v)*100 for v in line[1:]]) # cpu, ram return x, y diff --git a/scripts/testes.py b/scripts/testes.py index 587cf2a..3f88715 100644 --- a/scripts/testes.py +++ b/scripts/testes.py @@ -99,7 +99,7 @@ def run_tests(endpoint, num_requests): record_resource(files[1], num_request, cpu, ram) generate_req_graph(files[0], FRAMEWORK_NAME, endpoint) - generate_req_graph(files[1], FRAMEWORK_NAME, endpoint) + generate_resource_graph(files[1], FRAMEWORK_NAME, endpoint) time.sleep(3)