Cleanup histogram classes mixing SetFlags into FactoryGet arguments
Generic cleanup of histogram class, renaming *FactoryGet to FactoryGet,
along with reformatting.
The macros were cleaned up to use common sub-macros rather than
repeating code as much.
Removed ThreadSafeHistogram (and associated ASSET_HISTOGRAM macros)
since this class was not getting used.
I introduced UMA_HISTOGRAM_ENUMERATION to support the common use
of LinearHistograms to count various enumerated values.
I added a Flags argument to all the FactoryGet routines to help avoid
needing to call SetFlags each time a new sample is Add()ed. This also
simplifies the code.
This will all help prepare for a "don't histogram at all" macro setting
so that I can test the impact of the histogram macro calls on
performance (since there are now so many active histograms).
BUG=31206
r=raman.tenneti
Review URL: http://codereview.chromium.org/515033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35295 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: 2753b39e0c2e83d3b497ebadc2d720f12b74db40
diff --git a/base/message_loop.cc b/base/message_loop.cc
index 64913e5..9799100 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -265,7 +265,7 @@
pending_task.delayed_run_time =
Time::Now() + TimeDelta::FromMilliseconds(delay_ms);
} else {
- DCHECK(delay_ms == 0) << "delay should not be negative";
+ DCHECK_EQ(delay_ms, 0) << "delay should not be negative";
}
// Warning: Don't try to short-circuit, and handle this thread's tasks more
@@ -531,13 +531,10 @@
if (enable_histogrammer_ && !message_histogram_.get()
&& StatisticsRecorder::WasStarted()) {
DCHECK(!thread_name_.empty());
- message_histogram_ =
- LinearHistogram::LinearHistogramFactoryGet(
- ("MsgLoop:" + thread_name_),
- kLeastNonZeroMessageId,
- kMaxMessageId,
- kNumberOfDistinctMessagesDisplayed);
- message_histogram_->SetFlags(message_histogram_->kHexRangePrintingFlag);
+ message_histogram_ = LinearHistogram::FactoryGet("MsgLoop:" + thread_name_,
+ kLeastNonZeroMessageId, kMaxMessageId,
+ kNumberOfDistinctMessagesDisplayed,
+ message_histogram_->kHexRangePrintingFlag);
message_histogram_->SetRangeDescriptions(event_descriptions_);
}
}