mirror of https://github.com/ivanch/tcc.git
fix
This commit is contained in:
parent
83605f9095
commit
5199519634
|
@ -10,11 +10,11 @@ def plot_graph(x, y, title, x_label, y_label, filename):
|
||||||
|
|
||||||
plt.clf()
|
plt.clf()
|
||||||
|
|
||||||
def plot_resource_graph(x, y, title, x_label, y_label, filename):
|
def plot_resource_graph(x_data, y_data, title, x_label, y_label, filename):
|
||||||
requests = x
|
requests = x_data
|
||||||
resource = {
|
resource = {
|
||||||
'CPU': (p[0] for p in y),
|
'CPU': [p[0] for p in y_data],
|
||||||
'RAM': (p[1] for p in y),
|
'RAM': [p[1] for p in y_data],
|
||||||
}
|
}
|
||||||
|
|
||||||
x = np.arange(len(requests))
|
x = np.arange(len(requests))
|
||||||
|
@ -68,7 +68,7 @@ def get_resource_data(filename):
|
||||||
line = line.strip().split(',')
|
line = line.strip().split(',')
|
||||||
if line:
|
if line:
|
||||||
x.append(int(line[0])) # requests
|
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
|
return x, y
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ def run_tests(endpoint, num_requests):
|
||||||
record_resource(files[1], num_request, cpu, ram)
|
record_resource(files[1], num_request, cpu, ram)
|
||||||
|
|
||||||
generate_req_graph(files[0], FRAMEWORK_NAME, endpoint)
|
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)
|
time.sleep(3)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue