code: def view(src, mono):
      
      src_type, src_name = src
      title = get_title(src_name, src_type)
      viewer, loop = make_viewer(mono)
      if src_type == 'dump':
          time = datetime.fromtimestamp(os.path.getmtime(src_name))
          with open(src_name, 'rb') as f:
              profiler_class, (stats, cpu_time, wall_time) = pickle.load(f)
          viewer.set_profiler_class(profiler_class)
          viewer.set_result(stats, cpu_time, wall_time, title=title, at=time)
          viewer.activate()
      elif src_type in ('tcp', 'sock'):
          family = {'tcp': socket.AF_INET, 'sock': socket.AF_UNIX}[src_type]
          client = FailoverProfilingClient(viewer, loop.event_loop,
                                           src_name, family, title=title)
          client.start()
      try:
          loop.run()
      except KeyboardInterrupt:
          pass
docs: Inspect statistics by TUI view.