debian-cpu-benchmark add sysbench install guide
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess, multiprocessing as mp, pandas as pd
|
||||
|
||||
subprocess.run("sudo apt-get update && sudo apt-get install -y sysbench",
|
||||
shell=True, stdout=subprocess.PIPE)
|
||||
|
||||
def speed(core):
|
||||
output = subprocess.getoutput(
|
||||
f'sysbench cpu --threads={core} run | grep "events per second"')
|
||||
output = float(output.split()[-1])
|
||||
print(output)
|
||||
return output
|
||||
|
||||
try:
|
||||
output = subprocess.run(
|
||||
f'sysbench cpu --threads={core} run | grep "events per second"',
|
||||
shell=True, capture_output=True, text=True).stdout.split()[-1]
|
||||
print(output)
|
||||
return output
|
||||
except:
|
||||
print('\n'
|
||||
'sudo apt-get update && sudo apt-get install -y sysbench'
|
||||
'\tOR'
|
||||
'brew install sysbench'
|
||||
'\n')
|
||||
raise
|
||||
|
||||
df = []
|
||||
for core in range(1, mp.cpu_count()+1):
|
||||
s = speed(core)
|
||||
|
||||
Reference in New Issue
Block a user