Changeset 994
- Timestamp:
- 03/02/06 14:02:39
- Files:
-
- trunk/cherrypy/test/benchmark.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/benchmark.py
r993 r994 15 15 MOUNT_POINT = "/cpbench/users/rdelon/apps/blog" 16 16 17 __all__ = ['ABSession', 'Root', 'print_ chart', 'read_process',17 __all__ = ['ABSession', 'Root', 'print_report', 'read_process', 18 18 'run_standard_benchmarks', 'safe_threads', 19 'size_ chart', 'startup', 'thread_chart',19 'size_report', 'startup', 'thread_report', 20 20 ] 21 21 … … 170 170 171 171 172 def thread_ chart(path=MOUNT_POINT + "/", concurrency=safe_threads):172 def thread_report(path=MOUNT_POINT + "/", concurrency=safe_threads): 173 173 sess = ABSession(path) 174 174 attrs, names, patterns = zip(*sess.parse_patterns) … … 180 180 return rows 181 181 182 def size_ chart(sizes=(1, 10, 50, 100, 100000, 100000000),182 def size_report(sizes=(1, 10, 50, 100, 100000, 100000000), 183 183 concurrency=50): 184 184 sess = ABSession(concurrency=concurrency) … … 191 191 return rows 192 192 193 def print_ chart(rows):193 def print_report(rows): 194 194 widths = [] 195 195 for i in range(len(rows[0])): … … 205 205 def run_standard_benchmarks(): 206 206 print 207 print "Thread Chart (1000 requests, 14 byte response body):"208 print_ chart(thread_chart())209 210 print 211 print "Thread Chart (1000 requests, 14 bytes via static_filter):"212 print_ chart(thread_chart("%s/static/index.html" % MOUNT_POINT))213 214 print 215 print "Size Chart (1000 requests, 50 threads):"216 print_ chart(size_chart())207 print "Thread Report (1000 requests, 14 byte response body):" 208 print_report(thread_report()) 209 210 print 211 print "Thread Report (1000 requests, 14 bytes via static_filter):" 212 print_report(thread_report("%s/static/index.html" % MOUNT_POINT)) 213 214 print 215 print "Size Report (1000 requests, 50 threads):" 216 print_report(size_report()) 217 217 218 218

