cpu-bench: rename csv
This commit is contained in:
2
cpu-bench/.gitignore
vendored
2
cpu-bench/.gitignore
vendored
@@ -1 +1 @@
|
||||
bench.csv
|
||||
.csv
|
||||
|
||||
@@ -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}')
|
||||
|
||||
Reference in New Issue
Block a user