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 87 of file dqmMemoryStats.py.

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

87 def displayDirectoryStatistics(stats, args):
88  group_stats = stats.group(args.depth, args.count)
89 
90  cutoff, display = args.cutoff * 1024, args.display
91 
92  as_list = [(v, k, ) for (k, v) in group_stats.items()]
93  as_list.sort(reverse=True, key=lambda v_k1: abs(v_k1[0]))
94 
95  if cutoff is not None:
96  as_list = [v_k for v_k in as_list if abs(v_k[0]) > cutoff]
97 
98  if display is not None:
99  as_list = as_list[:display]
100 
101  if args.human:
102  print "*" * 80
103  print (" DQM level %d folder breakdown " % args.depth).center(80, "*")
104  if cutoff:
105  print ("* Size cutoff: %s" % kibisize(cutoff,args)).ljust(79) + "*"
106  if display:
107  print ("* Showing top %d entries." % display).ljust(79) + "*"
108  print "*" * 80
109 
110  for v, k in as_list:
111  if args.human:
112  print kibisize(v,args).ljust(16, " "), k
113  else:
114  print v, k
115 
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 76 of file dqmMemoryStats.py.

References str.

Referenced by displayDirectoryStatistics().

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