From dde8102cc579dcba31552deca6022107abc7dfb6 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 16 Nov 2019 12:09:51 +0100 Subject: [PATCH] Added script for plotting profiling data --- .gitignore | 1 + tests/profilestats.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 tests/profilestats.py diff --git a/.gitignore b/.gitignore index 77308910..f772cce6 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ sample/**/*.json tests/temp .pytest_cache pytestdebug.log +prof/ # Coverage .coverage diff --git a/tests/profilestats.py b/tests/profilestats.py new file mode 100755 index 00000000..f55c7b01 --- /dev/null +++ b/tests/profilestats.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import pstats + +from os import path + +profDir = path.abspath(path.join(path.dirname(__file__),"..","prof")) + +print("") +print("Profiles directory: %s" % profDir) +print("") + +profMainWindows = pstats.Stats(path.join(profDir,"testMainWindows.prof")) +profMainWindows.sort_stats("cumtime") +profMainWindows.print_stats("nw",50)