nose-psprofile

A performance profiler for NOSE testing based on psutil package


Keywords
ps, profile, performance, nose, plugin
License
MIT-feh
Install
pip install nose-psprofile

Documentation

nose-psprofile

A performance profiler for NOSE testing based on psutil package

This module is a nose plugin to profile a given pid and generate json data with the profile data.

In order to integrate it to your test cases see the following code snippet:

    import psprofile

    default_argv = [    test_module_path,
                        test_module_uri,
                        "-d",
                        "-s",
                        "--verbosity=%s" % verbosity,
                        "--with-psprofile",
                        "--psprofile-file=%s.json" % test
                    ]

    nose.run(argv = default_argv, addplugins = [psprofile.PSProfile()])

Within a script should be execute same as above, for more info why see: http://code.google.com/p/python-nose/issues/detail?id=105

    "*ALSO NOTE* that if you pass a unittest.TestSuite
    instance as the suite, context fixtures at the class, module and
    package level will not be used, and many plugin hooks will not
    be called. If you want normal nose behavior, either pass a list
    of tests, or a fully-configured `nose.suite.ContextSuite`_."

The module relies on the psutil module, for more info about it, take a look to the pip site.