|
|
DescriptionFix the Chrome OS ResourceReporter
The currently reported samples are noisy and useless. We can't extract
any useful info from them. This CL is an attempt to fix that by doing
the following:
- Report only intensive cpu (>70%) and memory (>60% of phy memory per cpu) users.
- Listen to the task manager only once, get the full data and stop it once there's
something to report.
- Use system time instead of time ticks to accurately measure the time
between reporting samples, so that it makes sense between reboots.
- Update the unit tests.
BUG=649486
TEST=unit_tests --gtest_filter=ResourceReporterTest.*
Committed: https://crrev.com/5b2b3d9f1582f69b1dac375a73881271ed7b96c5
Cr-Commit-Position: refs/heads/master@{#424855}
Patch Set 1 : [WIP] Still need to fix unittests #Patch Set 2 : RFR #Patch Set 3 : Fix 2 browser_tests #Patch Set 4 : Fix time #Patch Set 5 : clean-up #Patch Set 6 : Fix 2 browser_tests #
Total comments: 4
Patch Set 7 : No hardcoded memory threshold, keep watch TM until something will be reported or mem pressure level… #
Total comments: 2
Patch Set 8 : DI for the task manager to observe #
Total comments: 1
Messages
Total messages: 50 (35 generated)
Description was changed from ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu and memory users. - TODO: add more. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ========== to ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>800MB) users. - Listen to the task manager only once, get the full data and stop it. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ==========
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>800MB) users. - Listen to the task manager only once, get the full data and stop it. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ========== to ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>800MB) users. - Listen to the task manager only once, get the full data and stop it. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ==========
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
afakhry@chromium.org changed reviewers: + nick@chromium.org
Nick, could you please take a look at this CL? Thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Glad to see you're respinning this. lgtm https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter.cc (right): https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter.cc:68: constexpr base::TimeDelta kMinimumTimeBetweenReports = constexpr + TimeDelta is an amazing combo. https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc (right): https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc:141: content::TestBrowserThreadBundle thread_bundle_; The TestBrowserThreadBundle usually works best when it's the first data member of a class (i.e. that would let DummyTaskManager interact with browserthreads in its ctor/dtor)
Description was changed from ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>800MB) users. - Listen to the task manager only once, get the full data and stop it. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ========== to ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>60% of phy memory per cpu) users. - Listen to the task manager only once, get the full data and stop it once there's something to report. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ==========
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Nick, here's what I found. - Hard coded memory usage threshold is a bad idea! It should be device dependent. I found that 60% of physical memory per CPU is a good value. - When we are under critical memory pressure, we're notified once per second! It's a bad idea to stop observing and then reobserving the task manager when we have no violators to report (and hence no rappor sampling time will be stored). -- So I made it that we keep listening to the TM as long as memory pressure level remains critical AND we have nothing to report yet (i.e. next refresh might give us something to report). I also updated the unit tests to be much more accurate. https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter.cc (right): https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter.cc:68: constexpr base::TimeDelta kMinimumTimeBetweenReports = On 2016/09/29 21:32:11, ncarter wrote: > constexpr + TimeDelta is an amazing combo. Absolutely! https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc (right): https://codereview.chromium.org/2363223002/diff/100001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc:141: content::TestBrowserThreadBundle thread_bundle_; On 2016/09/29 21:32:12, ncarter wrote: > The TestBrowserThreadBundle usually works best when it's the first data member > of a class (i.e. that would let DummyTaskManager interact with browserthreads in > its ctor/dtor) Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2363223002/diff/120001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter.h (right): https://codereview.chromium.org/2363223002/diff/120001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter.h:172: task_manager::TaskManagerInterface* task_manager_for_testing_; A for_testing_ data member should be a last resort, since it'll result in codeblocks in the .cc file that are unreachable in unittests. Two ways I see to switch this to dependency injection: (1) is to pass the TaskManagerInterface in the ctor. That's awkward to impossible with a singleton, so I'd suggest instead: (2) Pass a TaskManagerInterface* to StartMonitoring. Then this member can be, like, task_manager_to_observe_, with a comment. Then ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() just gets the real TM singleton instance, and passes it on.
https://codereview.chromium.org/2363223002/diff/120001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter.h (right): https://codereview.chromium.org/2363223002/diff/120001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter.h:172: task_manager::TaskManagerInterface* task_manager_for_testing_; A for_testing_ data member should be a last resort, since it'll result in codeblocks in the .cc file that are unreachable in unittests. Two ways I see to switch this to dependency injection: (1) is to pass the TaskManagerInterface in the ctor. That's awkward to impossible with a singleton, so I'd suggest instead: (2) Pass a TaskManagerInterface* to StartMonitoring. Then this member can be, like, task_manager_to_observe_, with a comment. Then ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() just gets the real TM singleton instance, and passes it on.
The CQ bit was checked by afakhry@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2363223002/diff/120001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter.h (right): https://codereview.chromium.org/2363223002/diff/120001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter.h:172: task_manager::TaskManagerInterface* task_manager_for_testing_; On 2016/10/07 19:04:16, ncarter wrote: > A for_testing_ data member should be a last resort, since it'll result in > codeblocks in the .cc file that are unreachable in unittests. Two ways I see to > switch this to dependency injection: > > (1) is to pass the TaskManagerInterface in the ctor. That's awkward to > impossible with a singleton, so I'd suggest instead: > > (2) Pass a TaskManagerInterface* to StartMonitoring. > > Then this member can be, like, task_manager_to_observe_, with a comment. Then > ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() just gets the real TM > singleton instance, and passes it on. That's a great suggestion actually! Done. Thanks!
lgtm
afakhry@chromium.org changed reviewers: + gab@chromium.org, stevenjb@chromium.org
gab@chromium.org: Please review changes in >> browser_prefs.cc stevenjb@chromium.org: Please review changes in >> chrome_browser_main_chromeos.cc
afakhry@chromium.org changed reviewers: - gab@chromium.org, stevenjb@chromium.org
afakhry@chromium.org changed reviewers: + derat@chromium.org, pam@chromium.org
stevenjb and gab are OOO. pam@chromium.org: Please review changes in >> browser_prefs.cc derat@chromium.org: Please review changes in >> chrome_browser_main_chromeos.cc
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
rubber-stamp lgtm for chrome_browser_main_chromeos.cc
On 2016/10/12 19:56:37, Daniel Erat wrote: > rubber-stamp lgtm for chrome_browser_main_chromeos.cc rubber-stamp LGTM for chrome/browser/prefs/browser_prefs.cc
The CQ bit was checked by afakhry@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>60% of phy memory per cpu) users. - Listen to the task manager only once, get the full data and stop it once there's something to report. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ========== to ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>60% of phy memory per cpu) users. - Listen to the task manager only once, get the full data and stop it once there's something to report. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ==========
Message was sent while issue was closed.
Committed patchset #8 (id:140001)
Message was sent while issue was closed.
Description was changed from ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>60% of phy memory per cpu) users. - Listen to the task manager only once, get the full data and stop it once there's something to report. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* ========== to ========== Fix the Chrome OS ResourceReporter The currently reported samples are noisy and useless. We can't extract any useful info from them. This CL is an attempt to fix that by doing the following: - Report only intensive cpu (>70%) and memory (>60% of phy memory per cpu) users. - Listen to the task manager only once, get the full data and stop it once there's something to report. - Use system time instead of time ticks to accurately measure the time between reporting samples, so that it makes sense between reboots. - Update the unit tests. BUG=649486 TEST=unit_tests --gtest_filter=ResourceReporterTest.* Committed: https://crrev.com/5b2b3d9f1582f69b1dac375a73881271ed7b96c5 Cr-Commit-Position: refs/heads/master@{#424855} ==========
Message was sent while issue was closed.
Patchset 8 (id:??) landed as https://crrev.com/5b2b3d9f1582f69b1dac375a73881271ed7b96c5 Cr-Commit-Position: refs/heads/master@{#424855}
Message was sent while issue was closed.
gab@chromium.org changed reviewers: + gab@chromium.org
Message was sent while issue was closed.
c/b/prefs lgtm % comment https://codereview.chromium.org/2363223002/diff/140001/chrome/browser/chromeo... File chrome/browser/chromeos/resource_reporter/resource_reporter.cc (right): https://codereview.chromium.org/2363223002/diff/140001/chrome/browser/chromeo... chrome/browser/chromeos/resource_reporter/resource_reporter.cc:64: constexpr char kLastRapporReportTimeKey[] = Prefs are usually defined in their owns pref_names.h files, e.g.: https://cs.chromium.org/search/?q=file:pref_names%5C.h&sq=package:chromium&ty... |