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