def createCallHistogramTable(self): t = Report.Table(["Call", "# of Calls"]) hist = TraceOperations.calculateCallHistogram(self.trace) values = [(count, name) for name, count in hist.items()] for i, value in enumerate(sorted(values, reverse = True)): count, name = value t.addRow(name, count) return t
def createCallHistogramTable(self): t = Report.Table(["Call", "# of Calls"]) hist = TraceOperations.calculateCallHistogram(self.trace) values = [(count, name) for name, count in hist.items()] for i, value in enumerate(sorted(values, reverse=True)): count, name = value t.addRow(name, count) return t
def histogram(trace): s = StringIO.StringIO() print >> s, "Call histogram:" hist = TraceOperations.calculateCallHistogram(trace) values = [(count, name) for name, count in hist.items()] for i, value in enumerate(sorted(values, reverse=True)): count, name = value print >> s, "%4d. %8d - %s" % (i + 1, count, name) print >> s return s.getvalue()
def histogram(trace): s = StringIO.StringIO() print >>s, "Call histogram:" hist = TraceOperations.calculateCallHistogram(trace) values = [(count, name) for name, count in hist.items()] for i, value in enumerate(sorted(values, reverse = True)): count, name = value print >>s, "%4d. %8d - %s" % (i + 1, count, name) print >>s return s.getvalue()
def showCallHistogram(self, traceName): """ Show the function call frequency histogram for a trace. @param traceName: Name of the trace to examine """ if not traceName in self.analyzer.traces: self.analyzer.fail("Trace not found: %s" % traceName) trace = self.analyzer.traces[traceName] hist = TraceOperations.calculateCallHistogram(trace) width = 40 largest = max(hist.values()) values = [(count, name) for name, count in hist.items()] for i, value in enumerate(sorted(values, reverse = True)): count, name = value self.reportInfo("%3d. %-25s %5d %s" % (i + 1, name, count, "#" * int(width * float(count) / largest)))
def showCallHistogram(self, traceName): """ Show the function call frequency histogram for a trace. @param traceName: Name of the trace to examine """ if not traceName in self.analyzer.traces: self.analyzer.fail("Trace not found: %s" % traceName) trace = self.analyzer.traces[traceName] hist = TraceOperations.calculateCallHistogram(trace) width = 40 largest = max(hist.values()) values = [(count, name) for name, count in hist.items()] for i, value in enumerate(sorted(values, reverse=True)): count, name = value self.reportInfo("%3d. %-25s %5d %s" % (i + 1, name, count, "#" * int(width * float(count) / largest)))