class_docstr: Unit test for PerformanceProfiler.
class_docstr_tok: ["Unit","test","for","PerformanceProfiler","."]
code: def test_tracer_time_window(self):
      pipe0 = (
          pipe.input("d")
          .flat_map(
              "d",
              ("n1", "n2", "t"),
              lambda x: ((a, b, c) for a, b, c in x),
          )
          .time_window(
              ("n1", "n2"), ("s1", "s2"), "t", 10, 5, ops.local.sum2()
          )
          .output("s1", "s2")
      )
      data = [
          (i, i + 1, i * 1000) for i in range(100) if i < 3 or i > 91
      ]
      v = pipe0.debug(data, profiler=True)
  
      pp = v.profiler
      self.assertEqual(len(pp.pipes_profiler), 1)
      self.assertEqual(len(pp.node_report), 4)
      pp.show()
  
imports: import json
  import unittest
  from pathlib import Path
  from towhee import pipe
  from towhee import ops, register
  from towhee.runtime.time_profiler import TimeProfiler
  from towhee.tools.profilers import PerformanceProfiler
label_desc: Use image node_id 4 for calling the TestPerformanceProfiler obj's underlying member method code with example usage: obj.test_tracer_time_window() without return types