cpu-bench: rename csv

This commit is contained in:
Jaewook Lee
2024-08-12 18:31:14 +09:00
parent ba882aed3b
commit c6ee6626e5
2 changed files with 3 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ from tabulate import tabulate
warnings.filterwarnings("ignore")
R, G, B, W = (f'\x1b[{x}m' for x in (31, 32, 34, 0))
subprocess.run('neofetch')
print(f'{R}$ sysbench cpu --threads={core} run | grep "events per second"{W}'
print(f'{G}$ sysbench cpu --threads=$(nproc) run | grep "events per second"{W}')
def speed(core):
output = subprocess.run(
@@ -23,7 +23,7 @@ for core in range(1, mp.cpu_count()+1):
}
df.append(row)
df = pd.DataFrame(df)
df.to_csv('bench.csv', index=False)
df.to_csv('result.csv', index=False)
df.iloc[:, 0] = df.iloc[:, 0].apply(lambda s: f'{R}{s}{W}')
df.iloc[:, 1] = df.iloc[:, 1].apply(lambda s: f'{G}{int(s)}{W}')