From c6ee6626e5d49e4fa7253f6b74e8b170004ed27e Mon Sep 17 00:00:00 2001 From: Jaewook Lee <11328376+jaewooklee93@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:31:14 +0900 Subject: [PATCH] cpu-bench: rename csv --- cpu-bench/.gitignore | 2 +- cpu-bench/bench.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu-bench/.gitignore b/cpu-bench/.gitignore index df68529..df2929e 100644 --- a/cpu-bench/.gitignore +++ b/cpu-bench/.gitignore @@ -1 +1 @@ -bench.csv +.csv diff --git a/cpu-bench/bench.py b/cpu-bench/bench.py index df9d097..14df329 100755 --- a/cpu-bench/bench.py +++ b/cpu-bench/bench.py @@ -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}')