Avoid use of UMA_HISTOGRAM_COUNTS

UMA_HISTOGRAM_COUNTS is documented as deprecated and defaults to
creating larger histograms than are needed by Crashpad.

Bug: chromium:1237013
Change-Id: Ic133e05bce41759a11dbb523d84afc5246c6dc37
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3075884
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Joshua Peraza 2021-08-05 12:35:36 -07:00 committed by Crashpad LUCI CQ
parent 7451893cd8
commit 1db7e2b547

View File

@ -37,18 +37,23 @@ namespace {
//! \brief Metrics values used to track the start and completion of a crash
//! handling. These are used as metrics values directly, so
//! enumeration values so new values should always be added at the end.
//! enumeration values so new values should always be added at the end,
//! before kMaxValue.
enum class ExceptionProcessingState {
//! \brief Logged when exception processing is started.
kStarted = 0,
//! \brief Logged when exception processing completes.
kFinished = 1,
//! \brief An invalid value.
kMaxValue,
};
void ExceptionProcessing(ExceptionProcessingState state) {
UMA_HISTOGRAM_COUNTS("Crashpad.ExceptionEncountered",
static_cast<int32_t>(state));
UMA_HISTOGRAM_ENUMERATION("Crashpad.ExceptionEncountered",
state,
ExceptionProcessingState::kMaxValue);
}
} // namespace
@ -70,7 +75,7 @@ void Metrics::CrashReportSize(FileOffset size) {
// static
void Metrics::CrashUploadAttempted(bool successful) {
UMA_HISTOGRAM_COUNTS("Crashpad.CrashUpload.AttemptSuccessful", successful);
UMA_HISTOGRAM_BOOLEAN("Crashpad.CrashUpload.AttemptSuccessful", successful);
}
// static