Commits

tleeuwenburg  committed 02db993

Push the demonstration project to the repo for the walkthrough

  • Participants
  • Parent commits af14d82

Comments (0)

Files changed (5)

 Package Name: Benchmarker.py
-Version: 0.1
+Version: 0.27
 Release Date: 29 April 2011
 
 This package provides a decorator which can be applied to any function in order 

File bench/benchmarker.py

         profiler.dump_stats(LOGFILE_NAME)
         STOPPED = True
         
+def suspend_recording():
+    '''
+    A hook to allow the profiling to be explicitly stopped. Stats are
+    NOT dumped to disk.
+    '''
+    
+    global STOPPED
+    STOPPED = True
         
 def restart_recording():
     '''

File bench/submit_codespeed.py

 #   limitations under the License.
 
 '''
-** NOTE: This code has only been tested with codespeed version 0.7.0 !! **
-
 This module exists to provide integration between the benchmarker.py module
 and the codespeed benchmarking visualisation server. Benchmarker.py will
 work perfectly well without this module, as its job is simply data collection.

File demonstration/demo_project/conftest.py

-"""GFE specific hooks and configuration for pytest.
-
-Here we configure pytest to add an option that allows us to specify
-any number of GFE test environments for use in distributed testing.
-
-If distributed testing is requested but no test execution environments
-are specified then we default to the localhost with twice the number
-of reported cpus.
-
-This module contains the functionality to setup all the test execution
-environments based on the local GFE env.
-"""
-
-import py
-
-import benchmarker
-benchmarker.suspend_recording() # By default, do NOT record tests when testing
-
-#class BenchmarkWrapper:
-#
-#    def __init__(self):
-#        print "Initialising the Benchmark Wrapper"
-#
-#    def pytest_pyfunc_call(self, pyfuncitem):
-##        import rpdb2
-##        rpdb2.start_embedded_debugger('0')
-#        pass
-
-
-def pytest_addoption(parser):
-    """pytest hook that adds a GFE specific option.
-
-    This option allows any number of GFE test execution environments
-    to be specified.
-    """
-
-    # Add options.
-    group = parser.getgroup('benchmarking options')
-    group.addoption('--bench_all', dest='benchall', action='store_true', default=False,
-                    help=('benchmark every single test'))
-
-
-def pytest_configure(config):
-    # Activate benchmarker plugin if appropriate.
-    if config.getvalue("bench_all"):
-        benchmarker.restart_recording()
 from distutils.core import setup
 import sys
 
-sys.path.append('bench')
-import bench
+#sys.path.append('bench')
+#import bench
 
 setup(name='benchmarker.py',
-      version='0.1',
+      version='0.28',
       author='Tennessee Leeuwenburg',
       author_email='tleeuwenburg@gmail.com',
       description='Benchmarking for basically no effort.',      
       url='https://bitbucket.org/tleeuwenburg/benchmarker.py',
-      download_url='https://bitbucket.org/tleeuwenburg/benchmarker.py/downloads',
       packages=['bench'],
       keywords='benchmarking, profiling',
       license='Apache License 2.0',
-      classifiers=['Development Status :: 1 - Alpha',
+      classifiers=['Development Status :: 3 - Alpha',
                    'Intended Audience :: Developers',
                    'Natural Language :: English',
                    'Operating System :: OS Independent',