CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
Vispa.Share.Profiling Namespace Reference

Functions

def analyze
 

Function Documentation

def Vispa.Share.Profiling.analyze (   function,
  filename,
  filter = None 
)

Definition at line 11 of file Profiling.py.

11 
12 def analyze(function,filename,filter=None):
13  profilename=os.path.join(logDirectory,os.path.splitext(os.path.basename(filename))[0]+"_profile")
14  cProfile.run(function,profilename)
15  p = pstats.Stats(profilename)
16  p.strip_dirs()
17  p.sort_stats("cumulative")
18  f="^(?!unittest.py)"
19  if filter!=None:
20  f+=filter
21  p.print_stats(f,30)