Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py

Issue 898673005: [telemetry] Add a V8GCTimes measurement and benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py
diff --git a/tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py b/tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py
index 9ef814f349f0d96bc69bb96e5843ce0b8ad5d225..0a23ae4a7bc1ae8d24efd1a0dd7ced0332881eea 100644
--- a/tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py
+++ b/tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py
@@ -22,16 +22,6 @@ from telemetry.web_perf import timeline_interaction_record as tir_module
from telemetry.web_perf.metrics import timeline_based_metric
-class FakeFastMetric(timeline_based_metric.TimelineBasedMetric):
-
- def AddResults(self, model, renderer_thread, interaction_records, results):
- results.AddValue(scalar.ScalarValue(
- results.current_page, 'FakeFastMetric', 'ms', 1))
- results.AddValue(scalar.ScalarValue(
- results.current_page, 'FastMetricRecords', 'count',
- len(interaction_records)))
-
-
class FakeSmoothMetric(timeline_based_metric.TimelineBasedMetric):
def AddResults(self, model, renderer_thread, interaction_records, results):
@@ -53,8 +43,6 @@ class FakeLoadingMetric(timeline_based_metric.TimelineBasedMetric):
def GetMetricFromMetricType(metric_type):
- if metric_type == tir_module.IS_FAST:
- return FakeFastMetric()
if metric_type == tir_module.IS_SMOOTH:
return FakeSmoothMetric()
if metric_type == tir_module.IS_RESPONSIVE:
@@ -130,7 +118,7 @@ class TimelineBasedMetricsTests(unittest.TestCase):
d.AddInteraction(d.renderer_thread, ts=25, duration=5,
marker='Interaction.LogicalName2/is_responsive')
d.AddInteraction(d.foo_thread, ts=50, duration=15,
- marker='Interaction.LogicalName3/is_fast')
+ marker='Interaction.LogicalName3/is_smooth')
d.FinalizeImport()
self.assertEquals(2, len(d.threads_to_records_map))
@@ -151,7 +139,7 @@ class TimelineBasedMetricsTests(unittest.TestCase):
self.assertIn(d.foo_thread, d.threads_to_records_map)
interactions = d.threads_to_records_map[d.foo_thread]
self.assertEquals(1, len(interactions))
- self.assertTrue(interactions[0].is_fast)
+ self.assertTrue(interactions[0].is_smooth)
self.assertEquals(50, interactions[0].start)
self.assertEquals(65, interactions[0].end)
@@ -161,16 +149,12 @@ class TimelineBasedMetricsTests(unittest.TestCase):
marker='Interaction.LogicalName1/is_smooth')
d.AddInteraction(d.foo_thread, ts=25, duration=5,
marker='Interaction.LogicalName2/is_responsive')
- d.AddInteraction(d.renderer_thread, ts=50, duration=15,
- marker='Interaction.LogicalName3/is_fast')
d.FinalizeImport()
d.AddResults()
self.assertEquals(1, len(d.results.FindAllPageSpecificValuesNamed(
'LogicalName1-FakeSmoothMetric')))
self.assertEquals(1, len(d.results.FindAllPageSpecificValuesNamed(
'LogicalName2-FakeLoadingMetric')))
- self.assertEquals(1, len(d.results.FindAllPageSpecificValuesNamed(
- 'LogicalName3-FakeFastMetric')))
def testDuplicateInteractionsInDifferentThreads(self):
d = TimelineBasedMetricTestData()
@@ -270,44 +254,6 @@ class TimelineBasedMeasurementTest(page_test_test_case.PageTestTestCase):
'DrawerAnimation-frame_time_discrepancy')
self.assertEquals(len(v), 1)
- # This test is flaky when run in parallel on the mac: crbug.com/426676
- # Also, fails on android: crbug.com/437057
- @decorators.Disabled('android', 'mac')
- def testFastTimelineBasedMeasurementForSmoke(self):
- ps = self.CreateEmptyPageSet()
- ps.AddUserStory(TestTimelinebasedMeasurementPage(
- ps, ps.base_dir, trigger_slow=True))
-
- tbm = tbm_module.TimelineBasedMeasurement(tbm_module.Options())
- measurement = tbm_module.TimelineBasedPageTest(tbm)
- results = self.RunMeasurement(measurement, ps, options=self._options)
-
- self.assertEquals([], results.failures)
- expected_names = set([
- 'SlowThreadJsRun-fast-duration',
- 'SlowThreadJsRun-fast-idle_time',
- 'SlowThreadJsRun-fast-incremental_marking',
- 'SlowThreadJsRun-fast-incremental_marking_outside_idle',
- 'SlowThreadJsRun-fast-mark_compactor',
- 'SlowThreadJsRun-fast-mark_compactor_outside_idle',
- 'SlowThreadJsRun-fast-scavenger',
- 'SlowThreadJsRun-fast-scavenger_outside_idle',
- 'SlowThreadJsRun-fast-total_garbage_collection',
- 'SlowThreadJsRun-fast-total_garbage_collection_outside_idle',
- 'trace',
- ])
- if platform.GetHostPlatform().GetOSName() != 'win':
- # CPU metric is only supported non-Windows platforms.
- expected_names.add('SlowThreadJsRun-fast-cpu_time')
- self.assertEquals(
- expected_names, set(v.name for v in results.all_page_specific_values))
-
- # In interaction_enabled_page.html, the "slow" interaction executes
- # a loop with window.performance.now() to wait 200ms.
- # fast-duration measures wall time so its value should be at least 200ms.
- v = results.FindAllPageSpecificValuesNamed('SlowThreadJsRun-fast-duration')
- self.assertGreaterEqual(v[0].value, 200.0)
-
# Disabled since mainthread_jank metric is not supported on windows platform.
# Also, flaky on the mac when run in parallel: crbug.com/426676
# Also, fails on android: crbug.com/437057

Powered by Google App Engine
This is Rietveld 408576698