CMS 3D CMS Logo

Classes | Functions
dqmMemoryStats Namespace Reference

Classes

class  HistogramAnalyzer
 

Functions

def displayDirectoryStatistics (stats, args)
 
def kibisize (num, args)
 

Function Documentation

def dqmMemoryStats.displayDirectoryStatistics (   stats,
  args 
)

Definition at line 83 of file dqmMemoryStats.py.

References funct.abs(), ALCARECOTkAlBeamHalo_cff.filter, and kibisize().

83 def displayDirectoryStatistics(stats, args):
84  group_stats = stats.group(args.depth)
85 
86  cutoff, display = args.cutoff * 1024, args.display
87 
88  as_list = [(v, k, ) for (k, v) in group_stats.items()]
89  as_list.sort(reverse=True, key=lambda (v, k): abs(v))
90 
91  if cutoff is not None:
92  as_list = filter(lambda (v, k): abs(v) > cutoff, as_list)
93 
94  if display is not None:
95  as_list = as_list[:display]
96 
97  if args.human:
98  print "*" * 80
99  print (" DQM level %d folder breakdown " % args.depth).center(80, "*")
100  if cutoff:
101  print ("* Size cutoff: %s" % kibisize(cutoff,args)).ljust(79) + "*"
102  if display:
103  print ("* Showing top %d entries." % display).ljust(79) + "*"
104  print "*" * 80
105 
106  for v, k in as_list:
107  if args.human:
108  print kibisize(v,args).ljust(16, " "), k
109  else:
110  print v, k
111 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def kibisize(num, args)
def displayDirectoryStatistics(stats, args)
def dqmMemoryStats.kibisize (   num,
  args 
)

Definition at line 74 of file dqmMemoryStats.py.

References harvestTrackValidationPlots.str.

Referenced by displayDirectoryStatistics().

74 def kibisize(num,args):
75  pStr="%."+str(args.precision)+"f %s"
76  for prefix in ['KiB','MiB','GiB']:
77  num /= 1024.0
78 
79  if num < 1024.0 or args.units == prefix:
80  return pStr % (num, prefix)
81  return pStr % (num, prefix)
82 
def kibisize(num, args)