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

Unified Diff: base/metrics/persistent_memory_allocator.h

Issue 2662083002: Create 'errors' histogram for failures. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | base/metrics/persistent_memory_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_memory_allocator.h
diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h
index fd66da23563b99ed1d17c43d90331b9263785aae..9fdef0192a66195bbadcac295f4ede384f9edfcb 100644
--- a/base/metrics/persistent_memory_allocator.h
+++ b/base/metrics/persistent_memory_allocator.h
@@ -286,6 +286,7 @@ class BASE_EXPORT PersistentMemoryAllocator {
// IMPORTANT: Callers must update tools/metrics/histograms/histograms.xml
// with the following histograms:
// UMA.PersistentAllocator.name.Allocs
+ // UMA.PersistentAllocator.name.Errors
// UMA.PersistentAllocator.name.UsedPct
void CreateTrackingHistograms(base::StringPiece name);
@@ -609,11 +610,15 @@ class BASE_EXPORT PersistentMemoryAllocator {
ref, type_id, size));
}
- const bool readonly_; // Indicates access to read-only memory.
- std::atomic<bool> corrupt_; // Local version of "corrupted" flag.
+ // Record an error in the internal histogram.
+ void RecordError(int error) const;
+
+ const bool readonly_; // Indicates access to read-only memory.
+ mutable std::atomic<bool> corrupt_; // Local version of "corrupted" flag.
HistogramBase* allocs_histogram_; // Histogram recording allocs.
HistogramBase* used_histogram_; // Histogram recording used space.
+ HistogramBase* errors_histogram_; // Histogram recording errors.
friend class PersistentMemoryAllocatorTest;
FRIEND_TEST_ALL_PREFIXES(PersistentMemoryAllocatorTest, AllocateAndIterate);
« no previous file with comments | « no previous file | base/metrics/persistent_memory_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698