1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 22:56:15 +01:00
github.com_openSUSE_osc/osc_hotshot.py
Dr. Peter Poeml 39779ec9bc - rewrite configuration handling
- move all configuration code into module osc/conf.py
  - now, the API server can be configured in .oscrc with
    apisrv = ...
  - also, 'scheme' (http/https) is no longer a module variable but can be
    configured
  - all config is in DEFAULT
- ignore vim swap files
- use urllib() convenience wrapper in some functions that used
  urllib2.urlopen() and had their own error handling. Instead, it seems to make
  sense -- in the future-- to create our own errors and propagate them up, in
  cases where the error handling of urlopen() is too generic
- rename get_slash_source() to meta_get_project_list() for consistency
- show local time in get_buildhistory(), not UTC
- rewrite help text of 'rebuildpac' command
- allow to run commandline.py from the commandline (without the wrapper)
- don't send a space when doing a POST request without body
2006-10-10 14:04:34 +00:00

33 lines
636 B
Python
Executable File

#!/usr/bin/env python
import hotshot, hotshot.stats
import tempfile
import os, sys
from osc import commandline
if __name__ == '__main__':
(fd, filename) = tempfile.mkstemp(prefix = 'osc_profiledata_', dir = '/dev/shm')
f = os.fdopen(fd)
try:
prof = hotshot.Profile(filename)
prof.runcall(commandline.main)
print 'run complete. analyzing.'
prof.close()
stats = hotshot.stats.load(filename)
stats.strip_dirs()
stats.sort_stats('time', 'calls')
stats.print_stats(20)
del stats
finally:
f.close()
os.unlink(filename)