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

Side by Side Diff: chrome/browser/chromeos/memory/oom_priority_manager.cc

Issue 549453005: Run athena on device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" 5 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 316
317 void OomPriorityManager::RecordDiscardStatistics() { 317 void OomPriorityManager::RecordDiscardStatistics() {
318 // Record a raw count so we can compare to discard reloads. 318 // Record a raw count so we can compare to discard reloads.
319 discard_count_++; 319 discard_count_++;
320 UMA_HISTOGRAM_CUSTOM_COUNTS( 320 UMA_HISTOGRAM_CUSTOM_COUNTS(
321 "Tabs.Discard.DiscardCount", discard_count_, 1, 1000, 50); 321 "Tabs.Discard.DiscardCount", discard_count_, 1, 1000, 50);
322 322
323 // TODO(jamescook): Maybe incorporate extension count? 323 // TODO(jamescook): Maybe incorporate extension count?
324 UMA_HISTOGRAM_CUSTOM_COUNTS( 324 UMA_HISTOGRAM_CUSTOM_COUNTS(
325 "Tabs.Discard.TabCount", GetTabCount(), 1, 100, 50); 325 "Tabs.Discard.TabCount", GetTabCount(), 1, 100, 50);
326 326 #if !defined(USE_ATHENA)
327 // Record the discarded tab in relation to the amount of simultaneously 327 // Record the discarded tab in relation to the amount of simultaneously
328 // logged in users. 328 // logged in users.
329 ash::MultiProfileUMA::RecordDiscardedTab( 329 ash::MultiProfileUMA::RecordDiscardedTab(
330 ash::Shell::GetInstance()->session_state_delegate()-> 330 ash::Shell::GetInstance()->session_state_delegate()->
331 NumberOfLoggedInUsers()); 331 NumberOfLoggedInUsers());
332 #endif
332 333
333 // TODO(jamescook): If the time stats prove too noisy, then divide up users 334 // TODO(jamescook): If the time stats prove too noisy, then divide up users
334 // based on how heavily they use Chrome using tab count as a proxy. 335 // based on how heavily they use Chrome using tab count as a proxy.
335 // Bin into <= 1, <= 2, <= 4, <= 8, etc. 336 // Bin into <= 1, <= 2, <= 4, <= 8, etc.
336 if (last_discard_time_.is_null()) { 337 if (last_discard_time_.is_null()) {
337 // This is the first discard this session. 338 // This is the first discard this session.
338 TimeDelta interval = TimeTicks::Now() - start_time_; 339 TimeDelta interval = TimeTicks::Now() - start_time_;
339 int interval_seconds = static_cast<int>(interval.InSeconds()); 340 int interval_seconds = static_cast<int>(interval.InSeconds());
340 // Record time in seconds over an interval of approximately 1 day. 341 // Record time in seconds over an interval of approximately 1 day.
341 UMA_HISTOGRAM_CUSTOM_COUNTS( 342 UMA_HISTOGRAM_CUSTOM_COUNTS(
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if (it == pid_to_oom_score_.end() || it->second != score) { 654 if (it == pid_to_oom_score_.end() || it->second != score) {
654 content::ZygoteHost::GetInstance()->AdjustRendererOOMScore(*iterator, 655 content::ZygoteHost::GetInstance()->AdjustRendererOOMScore(*iterator,
655 score); 656 score);
656 pid_to_oom_score_[*iterator] = score; 657 pid_to_oom_score_[*iterator] = score;
657 } 658 }
658 priority += priority_increment; 659 priority += priority_increment;
659 } 660 }
660 } 661 }
661 662
662 } // namespace chromeos 663 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/login_display_host_impl.cc ('k') | chrome/browser/fullscreen_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698