зеркало из https://github.com/microsoft/azure-cli.git
Performance: added more surrogate perf scenarios (infrastructure) (#2906)
* Added more proxy perf scenarios * Update the test to handle commands that failed to execute
This commit is contained in:
Родитель
878062e1f0
Коммит
3699ef7fde
|
@ -4,7 +4,7 @@
|
|||
# --------------------------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
from subprocess import check_output, STDOUT
|
||||
from subprocess import check_output, STDOUT, CalledProcessError
|
||||
|
||||
def mean(data):
|
||||
"""Return the sample arithmetic mean of data."""
|
||||
|
@ -37,7 +37,10 @@ def scenario(command):
|
|||
|
||||
test_command = 'time -p ' + command
|
||||
for i in range(loop):
|
||||
lines = check_output([test_command], shell=True, stderr=STDOUT).split('\n')
|
||||
try:
|
||||
lines = check_output([test_command], shell=True, stderr=STDOUT).split('\n')
|
||||
except CalledProcessError as e:
|
||||
lines = e.output.split('\n')
|
||||
real_time = float(lines[-4].split()[1])
|
||||
real.append(float(lines[-4].split()[1]))
|
||||
user.append(float(lines[-3].split()[1]))
|
||||
|
@ -52,4 +55,7 @@ def scenario(command):
|
|||
print('')
|
||||
|
||||
scenario('az')
|
||||
scenario('az cl')
|
||||
scenario('az cloud')
|
||||
scenario('az cloud list')
|
||||
scenario('az cloud show --this-does-not-exist')
|
||||
|
|
Загрузка…
Ссылка в новой задаче