Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
tools: use nearest-rank P90 in trace_report.py
Sandiv Dathunarachchibb7ea5db3af0
diff --git a/tests/test_trace_report.py b/tests/test_trace_report.pyindex 1e43d426e..bc0eeb7bf 100644--- a/tests/test_trace_report.py+++ b/tests/test_trace_report.py@@ -169,6 +169,20 @@ class StartMetricsTest(unittest.TestCase):class NavMetricsTest(unittest.TestCase):+ def test_frame_p90_uses_nearest_rank_for_unsorted_samples(self):+ for n, expected in ((1, 1), (5, 5), (9, 9), (10, 9), (11, 10), (20, 18), (100, 90)):+ with self.subTest(n=n):+ q = fake_trace(frames=list(range(n, 0, -1)))+ self.addCleanup(q.close)+ self.assertEqual(report.nav_metrics(q, PKG)["frame p90"], expected)++ def test_frame_p90_excludes_the_slowest_tenth_at_the_boundary(self):+ for n in (10, 20, 100):+ with self.subTest(n=n):+ q = fake_trace(frames=[16] * (9 * n // 10) + [1000] * (n // 10))+ self.addCleanup(q.close)+ self.assertEqual(report.nav_metrics(q, PKG)["frame p90"], 16)+def test_frame_times_draws_gpu_and_missed_deadlines(self):q = fake_trace(frames=[10, 12, 14, 16, 40], missed=2, draws=[(1100, 6), (1120, 8)], gpu=[(1101, 2), (1121, 4)])m = report.nav_metrics(q, PKG)diff --git a/tools/trace_report.py b/tools/trace_report.pyindex 8e67eb952..8947cd7dd 100644--- a/tools/trace_report.py+++ b/tools/trace_report.py@@ -17,6 +17,7 @@ frame times and missed deadlines over the whole recording.import argparseimport globimport json+import mathimport osimport reimport statistics@@ -128,7 +129,7 @@ def nav_metrics(q, package):if frames:out["frames"] = len(frames)out["frame median"] = statistics.median(frames)- out["frame p90"] = frames[min(len(frames) - 1, int(0.9 * len(frames)))]+ out["frame p90"] = frames[math.ceil(0.9 * len(frames)) - 1]if render is not None:draws = [r["dur"] / MS for r in q(slices(render, "s.name like 'DrawFrame%' and s.dur >= 0", "s.dur"))]if not frames: