CMS 3D CMS Logo

Classes | Functions
dqmMemoryStats Namespace Reference

Classes

class  HistogramAnalyzer
 

Functions

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

Function Documentation

def dqmMemoryStats.displayDirectoryStatistics (   stats,
  args 
)

Definition at line 81 of file dqmMemoryStats.py.

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

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

Definition at line 74 of file dqmMemoryStats.py.

Referenced by displayDirectoryStatistics().

74 def kibisize(num):
75  for prefix in ['KiB','MiB','GiB']:
76  num /= 1024.0
77 
78  if num < 1024.0:
79  return "%.2f %s" % (num, prefix)
80 
def kibisize(num)