summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2019-02-27 07:26:22 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2019-02-27 07:26:22 -0800
commiteb05ea9bd7464232bbc81a8a9bfb902717d77b43 (patch)
treed8734f7d38695627cd332d64b575d4bfad02f0e3
parent7d0810ef4fc3e17b59207f9d5b7aabe131f4c6f1 (diff)
downloadpsutil-eb05ea9bd7464232bbc81a8a9bfb902717d77b43.tar.gz
appveyor: run print scripts after tests
-rw-r--r--appveyor.yml2
-rw-r--r--scripts/internal/print_api_speed.py8
-rwxr-xr-xscripts/internal/winmake.py11
3 files changed, 14 insertions, 7 deletions
diff --git a/appveyor.yml b/appveyor.yml
index a5fe5d03..38a6a8e0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -64,6 +64,8 @@ test_script:
after_test:
- "%WITH_COMPILER% %PYTHON%/python.exe scripts/internal/winmake.py wheel"
+ - "%WITH_COMPILER% %PYTHON%/python.exe scripts/internal/print_access_denied.py"
+ - "%WITH_COMPILER% %PYTHON%/python.exe scripts/internal/print_api_speed.py"
artifacts:
- path: dist\*
diff --git a/scripts/internal/print_api_speed.py b/scripts/internal/print_api_speed.py
index 2266caa2..e635810f 100644
--- a/scripts/internal/print_api_speed.py
+++ b/scripts/internal/print_api_speed.py
@@ -33,7 +33,7 @@ import psutil
from scriptutils import hilite
-SORT_BY_TIME = False
+SORT_BY_TIME = False if psutil.POSIX else True
TOP_SLOWEST = 7
timings = []
@@ -66,10 +66,12 @@ def run():
# --- system
public_apis = []
+ ignore = ('wait_procs', 'process_iter', 'win_service_get',
+ 'win_service_iter')
for name in psutil.__all__:
obj = getattr(psutil, name, None)
if inspect.isfunction(obj):
- if name not in ('wait_procs', 'process_iter'):
+ if name not in ignore:
public_apis.append(name)
print(titlestr("SYSTEM APIS"))
@@ -102,7 +104,7 @@ def run():
def main():
global SORT_BY_TIME, TOP_SLOWEST
parser = argparse.ArgumentParser(description='Benchmark all API calls')
- parser.add_argument('-t', '--time', required=False, default=False,
+ parser.add_argument('-t', '--time', required=False, default=SORT_BY_TIME,
action='store_true', help="sort by timings")
parser.add_argument('-s', '--slowest', required=False, default=TOP_SLOWEST,
help="highlight the top N slowest APIs")
diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py
index 1f4fa8f2..cd26c67e 100755
--- a/scripts/internal/winmake.py
+++ b/scripts/internal/winmake.py
@@ -472,24 +472,27 @@ def install_git_hooks():
@cmd
def bench_oneshot():
"""Benchmarks for oneshot() ctx manager (see #799)."""
- install()
sh("%s -Wa scripts\\internal\\bench_oneshot.py" % PYTHON)
@cmd
def bench_oneshot_2():
"""Same as above but using perf module (supposed to be more precise)."""
- install()
sh("%s -Wa scripts\\internal\\bench_oneshot_2.py" % PYTHON)
@cmd
def print_access_denied():
- """Benchmarks for oneshot() ctx manager (see #799)."""
- install()
+ """Print AD exceptions raised by all Process methods."""
sh("%s -Wa scripts\\internal\\print_access_denied.py" % PYTHON)
+@cmd
+def print_api_speed():
+ """Benchmark all API calls."""
+ sh("%s -Wa scripts\\internal\\print_api_speed.py" % PYTHON)
+
+
def set_python(s):
global PYTHON
if os.path.isabs(s):