nose-performance is a handy performance testing plugin for Nose. Its main job? To keep an eye on how your network applications, like databases and memcache, are doing. Pretty cool, right?
This plugin works well with Zumanji to help you report and save your test results. It’s like having an extra set of eyes on your performance!
If you're looking to create some tests, you can inherit from PerformanceTest
. Here’s a quick example:
from noseperf.testcases import PerformanceTest
class MyTest(PerformanceTest):
def test_redis(self):
client = Redis()
for x in xrange(2 ** 16):
client.add('test-%x' % x, '1')
To run your test suite with the performance option, just use this command:
python runtests.py --with-performance example/
(We use runtests.py
because it helps us check our Django hooks.)
The results get recorded by default in test_results/performance.json. You can check it out using:
ls -lh test_results
total 2128
-rw-r--r-- 1 dcramer staff 1.0M Aug 27 18:10 performance.json
You can find more tests included in the example/. Also, if you're curious about what else you can do, try running nosetests --help | grep performance
.
This plugin only collects tests that inherit from PerformanceTest. There are two basic cases included: one for general installs and another specifically for Django:
Go to the Softpas website, press the 'Downloads' button, and pick the app you want to download and install—easy and fast!
SoftPas is your platform for the latest software and technology news, reviews, and guides. Stay up to date with cutting-edge trends in tech and software development.
Subscribe to newsletter
© Copyright 2024, SoftPas, All Rights Reserved.