Skip to content

Commit

Permalink
Add brave metrics to system_health.common_*
Browse files Browse the repository at this point in the history
  • Loading branch information
atuchin-m committed Dec 25, 2023
1 parent e015e7e commit 3f209d5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions chromium_src/tools/perf/benchmarks/system_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2023 The Brave Authors. All rights reserved.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at https://mozilla.org/MPL/2.0/.

import override_utils


def _add_brave_metrics(options):
options.ExtendTimelineBasedMetric(['braveNavigationMetric'])
return options


@override_utils.override_method(MobileCommonSystemHealth)
def CreateCoreTimelineBasedMeasurementOptions(self, original_method):
return _add_brave_metrics(original_method(self))


@override_utils.override_method(DesktopCommonSystemHealth)
def CreateCoreTimelineBasedMeasurementOptions(self, original_method):
return _add_brave_metrics(original_method(self))
9 changes: 9 additions & 0 deletions patches/tools-perf-benchmarks-system_health.py.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/tools/perf/benchmarks/system_health.py b/tools/perf/benchmarks/system_health.py
index b5d11fb82029d5db007b18d72da03d4bcd357de0..9fd46d179a95c8cd6982da0006fe41b4933802ee 100644
--- a/tools/perf/benchmarks/system_health.py
+++ b/tools/perf/benchmarks/system_health.py
@@ -261,3 +261,4 @@ class WebviewStartupSystemHealthBenchmark(perf_benchmark.PerfBenchmark):
@classmethod
def Name(cls):
return 'system_health.webview_startup'
+from import_inline import inline_file_from_src; inline_file_from_src("brave/chromium_src/tools/perf/benchmarks/system_health.py", globals(), locals())

0 comments on commit 3f209d5

Please sign in to comment.