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

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

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

References str.

Referenced by displayDirectoryStatistics().

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