MCPcopy
hub / github.com/tanelpoder/0xtools / create_latency_suite

Method create_latency_suite

xtop/tests/test_runner.py:163–186  ·  view source on GitHub ↗

Create latency analysis test suite

(self)

Source from the content-addressed store, hash-verified

161 return suite
162
163 def create_latency_suite(self) -> TestSuite:
164 """Create latency analysis test suite"""
165 suite = TestSuite("Latency Tests", "Latency analysis functionality")
166
167 base_cmd = f"python3 ../xtop-test.py -d {self.datadir} --from '{self.from_time}' --to '{self.to_time}'"
168
169 tests = [
170 ("syscall_latency", "System call latency percentiles",
171 f"{base_cmd} -g 'state,syscall' -l 'sc.p50_us,sc.p95_us,sc.p99_us' --limit 5 --format simple"),
172
173 ("io_latency", "I/O latency percentiles",
174 f"{base_cmd} -g 'state,exe' -l 'io.min_lat_us,io.avg_lat_us,io.max_lat_us' --limit 5 --format simple"),
175
176 ("syscall_histogram", "System call histogram",
177 f"{base_cmd} -g 'state,syscall' -l 'sclat_histogram' --limit 3 --format simple"),
178
179 ("io_histogram", "I/O histogram",
180 f"{base_cmd} -g 'state' -l 'iolat_histogram' --limit 3 --format simple"),
181 ]
182
183 for name, desc, cmd in tests:
184 suite.add_test(TestCase(name, desc, cmd))
185
186 return suite
187
188 def create_stack_suite(self) -> TestSuite:
189 """Create stack trace test suite"""

Callers 1

run_allMethod · 0.95

Calls 3

add_testMethod · 0.95
TestSuiteClass · 0.85
TestCaseClass · 0.85

Tested by

no test coverage detected