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

Unified Diff: chrome/browser/jankometer.cc

Issue 462027: Use factory to create histograms, and refcounts to track lifetimes... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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
« no previous file with comments | « chrome/browser/diagnostics/sqlite_diagnostics.cc ('k') | chrome/browser/net/dns_host_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/jankometer.cc
===================================================================
--- chrome/browser/jankometer.cc (revision 33932)
+++ chrome/browser/jankometer.cc (working copy)
@@ -91,13 +91,15 @@
: MaxMessageDelay_(excessive_duration),
slow_processing_counter_(std::string("Chrome.SlowMsg") + thread_name),
queueing_delay_counter_(std::string("Chrome.DelayMsg") + thread_name),
- process_times_((std::string("Chrome.ProcMsgL ") +
- thread_name).c_str(), 1, 3600000, 50),
- total_times_((std::string("Chrome.TotalMsgL ") +
- thread_name).c_str(), 1, 3600000, 50),
total_time_watchdog_(excessive_duration, thread_name, watchdog_enable) {
- process_times_.SetFlags(kUmaTargetedHistogramFlag);
- total_times_.SetFlags(kUmaTargetedHistogramFlag);
+ process_times_ = Histogram::HistogramFactoryGet(
+ (std::string("Chrome.ProcMsgL ") + thread_name),
+ 1, 3600000, 50);
+ total_times_ = Histogram::HistogramFactoryGet(
+ (std::string("Chrome.TotalMsgL ") + thread_name),
+ 1, 3600000, 50);
+ process_times_->SetFlags(kUmaTargetedHistogramFlag);
+ total_times_->SetFlags(kUmaTargetedHistogramFlag);
}
// Attaches the observer to the current thread's message loop. You can only
@@ -137,8 +139,8 @@
TimeTicks now = TimeTicks::Now();
if (begin_process_message_ != TimeTicks()) {
TimeDelta processing_time = now - begin_process_message_;
- process_times_.AddTime(processing_time);
- total_times_.AddTime(queueing_time_ + processing_time);
+ process_times_->AddTime(processing_time);
+ total_times_->AddTime(queueing_time_ + processing_time);
}
if (now - begin_process_message_ >
TimeDelta::FromMilliseconds(kMaxMessageProcessingMs)) {
@@ -208,8 +210,8 @@
// Counters for the two types of jank we measure.
StatsCounter slow_processing_counter_; // Messages with long processing time.
StatsCounter queueing_delay_counter_; // Messages with long queueing delay.
- Histogram process_times_; // Time spent processing task.
- Histogram total_times_; // Total of queueing plus processing time.
+ scoped_refptr<Histogram> process_times_; // Time spent processing task.
+ scoped_refptr<Histogram> total_times_; // Total queueing plus processing.
JankWatchdog total_time_watchdog_; // Watching for excessive total_time.
DISALLOW_EVIL_CONSTRUCTORS(JankObserver);
« no previous file with comments | « chrome/browser/diagnostics/sqlite_diagnostics.cc ('k') | chrome/browser/net/dns_host_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698