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

Unified Diff: third_party/leveldatabase/env_chromium.cc

Issue 862723002: leveldb: Moved to LevelDBEnv.IOError.BFE histogram entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/leveldatabase/env_chromium.cc
diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc
index a12edf486182b04c2d58490300a67a9d72c541f0..6aa55ce9fdadba85e9c6d3849454d4cac250ebd2 100644
--- a/third_party/leveldatabase/env_chromium.cc
+++ b/third_party/leveldatabase/env_chromium.cc
@@ -16,6 +16,7 @@
#include "base/metrics/histogram.h"
#include "base/process/process_metrics.h"
#include "base/stl_util.h"
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/leveldatabase/chromium_logger.h"
#include "third_party/re2/re2/re2.h"
@@ -326,6 +327,7 @@ class IDBEnv : public ChromiumEnv {
public:
IDBEnv() : ChromiumEnv() {
name_ = "LevelDBEnv.IDB";
+ uma_ioerror_base_name_ = name_ + ".IOError.PFE";
make_backup_ = true;
}
};
@@ -529,6 +531,7 @@ ChromiumEnv::ChromiumEnv()
bgsignal_(&mu_),
started_bgthread_(false),
kMaxRetryTimeMillis(1000) {
+ uma_ioerror_base_name_ = name_ + ".IOError.PFE";
dgrogan 2015/01/21 01:47:56 maybe use bFE to indicate base::File::Error instea
cmumford 2015/02/13 22:15:52 I started with that originally, but eventually got
}
ChromiumEnv::~ChromiumEnv() {
@@ -931,18 +934,17 @@ void ChromiumEnv::RecordBackupResult(bool result) const {
base::HistogramBase* ChromiumEnv::GetOSErrorHistogram(MethodID method,
int limit) const {
- std::string uma_name(name_);
- // TODO(dgrogan): This is probably not the best way to concatenate strings.
- uma_name.append(".IOError.").append(MethodIDToString(method));
+ std::string uma_name;
+ base::StringAppendF(&uma_name, "%s.%s", uma_ioerror_base_name_.c_str(),
+ MethodIDToString(method));
return base::LinearHistogram::FactoryGet(uma_name, 1, limit, limit + 1,
base::Histogram::kUmaTargetedHistogramFlag);
}
base::HistogramBase* ChromiumEnv::GetMethodIOErrorHistogram() const {
- std::string uma_name(name_);
- uma_name.append(".IOError");
- return base::LinearHistogram::FactoryGet(uma_name, 1, kNumEntries,
- kNumEntries + 1, base::Histogram::kUmaTargetedHistogramFlag);
+ return base::LinearHistogram::FactoryGet(
+ uma_ioerror_base_name_, 1, kNumEntries, kNumEntries + 1,
+ base::Histogram::kUmaTargetedHistogramFlag);
}
base::HistogramBase* ChromiumEnv::GetMaxFDHistogram(

Powered by Google App Engine
This is Rietveld 408576698