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

Side by Side Diff: content/browser/indexed_db/leveldb/leveldb_database.cc

Issue 862723002: leveldb: Moved to LevelDBEnv.IOError.BFE histogram entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on ToT (to very pretty histograms.xml) - no changes. Created 5 years, 9 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
« no previous file with comments | « no previous file | third_party/leveldatabase/env_chromium.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/indexed_db/leveldb/leveldb_database.h" 5 #include "content/browser/indexed_db/leveldb/leveldb_database.h"
6 6
7 #include <cerrno> 7 #include <cerrno>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 method_histogram_name.append(".EnvMethod"); 192 method_histogram_name.append(".EnvMethod");
193 base::LinearHistogram::FactoryGet( 193 base::LinearHistogram::FactoryGet(
194 method_histogram_name, 194 method_histogram_name,
195 1, 195 1,
196 leveldb_env::kNumEntries, 196 leveldb_env::kNumEntries,
197 leveldb_env::kNumEntries + 1, 197 leveldb_env::kNumEntries + 1,
198 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(method); 198 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(method);
199 199
200 std::string error_histogram_name(histogram_name); 200 std::string error_histogram_name(histogram_name);
201 201
202 if (result == leveldb_env::METHOD_AND_PFE) { 202 if (result == leveldb_env::METHOD_AND_BFE) {
203 DCHECK_LT(error, 0); 203 DCHECK_LT(error, 0);
204 error_histogram_name.append(std::string(".PFE.") + 204 error_histogram_name.append(std::string(".BFE.") +
205 leveldb_env::MethodIDToString(method)); 205 leveldb_env::MethodIDToString(method));
206 base::LinearHistogram::FactoryGet( 206 base::LinearHistogram::FactoryGet(
207 error_histogram_name, 207 error_histogram_name,
208 1, 208 1,
209 -base::File::FILE_ERROR_MAX, 209 -base::File::FILE_ERROR_MAX,
210 -base::File::FILE_ERROR_MAX + 1, 210 -base::File::FILE_ERROR_MAX + 1,
211 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(-error); 211 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(-error);
212 } 212 }
213 } 213 }
214 214
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 const leveldb::Slice start_slice = MakeSlice(start); 420 const leveldb::Slice start_slice = MakeSlice(start);
421 const leveldb::Slice stop_slice = MakeSlice(stop); 421 const leveldb::Slice stop_slice = MakeSlice(stop);
422 // NULL batch means just wait for earlier writes to be done 422 // NULL batch means just wait for earlier writes to be done
423 db_->Write(leveldb::WriteOptions(), NULL); 423 db_->Write(leveldb::WriteOptions(), NULL);
424 db_->CompactRange(&start_slice, &stop_slice); 424 db_->CompactRange(&start_slice, &stop_slice);
425 } 425 }
426 426
427 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); } 427 void LevelDBDatabase::CompactAll() { db_->CompactRange(NULL, NULL); }
428 428
429 } // namespace content 429 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/leveldatabase/env_chromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698