code: def report(self):
      import time
  
      if not self.options.report:
          return
      w = lambda *args: self.writer(self.u + " ".join(args))
      if "summary" in self.options.reports:
          w("APSW TRACE SUMMARY REPORT")
          w()
          w(
              "Program run time                   ",
              "%.03f seconds" % (time.time() - self.timestart,),
          )
          w(
              "Total connections                  ",
              str(self.numconnections),
          )
          w("Total cursors                      ", str(self.numcursors))
          w(
              "Number of threads used for queries ",
              str(len(self.threadsused)),
          )
      total = 0
      for k, v in self.queries.items():
          total += v
      fmtq = len("%d" % (total,)) + 1
      if "summary" in self.options.reports:
          w("Total queries                      ", str(total))
          w(
              "Number of distinct queries         ",
              str(len(self.queries)),
          )
          w(
              "Number of rows returned            ",
              str(self.rowsreturned),
          )
          total = 0
          for k, v in self.timings.items():
              for v2 in v:
                  total += v2
          w(
              "Time spent processing queries      ",
              "%.03f seconds" % (total / 1000000000.0),
          )
  
      # show most popular queries
      if "popular" in self.options.reports:
          w()
          w("MOST POPULAR QUERIES")
          w()
          for count, query in self.mostpopular(self.options.reportn):
              w(
                  "% *d"
                  % (
                      fmtq,
                      count,
                  ),
                  self.formatstring(query, "", False),
              )
  
      # show longest running (aggregate)
      if "aggregate" in self.options.reports:
          w()
          w("LONGEST RUNNING - AGGREGATE")
          w()
          fmtt = None
          for total, count, query in self.longestrunningaggregate(
              self.options.reportn
          ):
              if fmtt is None:
                  fmtt = len(fmtfloat(total / 1000000000.0)) + 1
              w(
                  "% *d %s"
                  % (
                      fmtq,
                      count,
                      fmtfloat(total / 1000000000.0, total=fmtt),
                  ),
                  self.formatstring(query, "", False),
              )
  
      # show longest running (individual)
      if "individual" in self.options.reports:
          w()
          w("LONGEST RUNNING - INDIVIDUAL")
          w()
          fmtt = None
          for t, query in self.longestrunningindividual(
              self.options.reportn
          ):
              if fmtt is None:
                  fmtt = len(fmtfloat(total / 1000000000.0)) + 1
              w(
                  fmtfloat(t / 1000000000.0, total=fmtt),
                  self.formatstring(query, "", False),
              )
  
imports: import time
  import sys
  import weakref
label_desc: Use image node_id 22 for calling the APSWTracer obj's underlying member method code with example usage: obj.report() without return types