Ejemplo n.º 1
0
def report_line_profile():
    print "\nFunction Line Time"
    print "-------------------------"
    lstats = line_profil.get_stats()
    stats = lstats.timings
    unit = lstats.unit
    for (fn, lineno, name), timings in sorted(stats.items()):
        line_profiler.show_func(fn, lineno, name, stats[fn, lineno, name], unit)
Ejemplo n.º 2
0
 def line_stats_text(self):
     if self._line_stats_text is None and DJ_PROFILE_USE_LINE_PROFILER:
         lstats = self.statobj.line_stats
         if self.func in lstats.timings:
             out = StringIO()
             fn, lineno, name = self.func
             show_func(fn, lineno, name, lstats.timings[self.func], lstats.unit, stream=out)
             self._line_stats_text = out.getvalue()
         else:
             self._line_stats_text = False
     return self._line_stats_text
 def line_stats_text(self):
     if self._line_stats_text is None:
         lstats = self.statobj.line_stats
         if self.func in lstats.timings:
             out = cStringIO()
             fn, lineno, name = self.func
             try:
                 show_func(fn, lineno, name, lstats.timings[self.func], lstats.unit, stream=out)
                 self._line_stats_text = out.getvalue()
             except ZeroDivisionError:
                 self._line_stats_text = "There was a ZeroDivisionError, total_time was probably zero"
         else:
             self._line_stats_text = False
     return self._line_stats_text
 def line_stats_text(self):
     if self._line_stats_text is None:
         lstats = self.statobj.line_stats
         if self.func in lstats.timings:
             out = cStringIO()
             fn, lineno, name = self.func
             try:
                 show_func(fn,
                           lineno,
                           name,
                           lstats.timings[self.func],
                           lstats.unit,
                           stream=out)
                 self._line_stats_text = out.getvalue()
             except ZeroDivisionError:
                 self._line_stats_text = ("There was a ZeroDivisionError, "
                                          "total_time was probably zero")
         else:
             self._line_stats_text = False
     return self._line_stats_text