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

Side by Side Diff: base/metrics/persistent_histogram_allocator.h

Issue 2023253002: Merge subprocess metrics into global StatisticsRecorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed compile problems Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_PERSISTENCE_H_
6 #define BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ 6 #define BASE_METRICS_HISTOGRAM_PERSISTENCE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 int maximum, 241 int maximum,
242 const BucketRanges* bucket_ranges, 242 const BucketRanges* bucket_ranges,
243 int32_t flags, 243 int32_t flags,
244 Reference* ref_ptr); 244 Reference* ref_ptr);
245 245
246 // Finalize the creation of the histogram, making it available to other 246 // Finalize the creation of the histogram, making it available to other
247 // processes if |registered| (as in: added to the StatisticsRecorder) is 247 // processes if |registered| (as in: added to the StatisticsRecorder) is
248 // True, forgetting it otherwise. 248 // True, forgetting it otherwise.
249 void FinalizeHistogram(Reference ref, bool registered); 249 void FinalizeHistogram(Reference ref, bool registered);
250 250
251 // Merges the data in a persistent histogram with one held globally by the
252 // StatisticsRecorder, updating the "logged" samples within the passed
253 // object so that repeated merges are allowed.
254 void MergeHistogramToStatisticsRecorder(HistogramBase* histogram);
255
251 // Returns the object that manages the persistent-sample-map records for a 256 // Returns the object that manages the persistent-sample-map records for a
252 // given |id|. Only one |user| of this data is allowed at a time. This does 257 // given |id|. Only one |user| of this data is allowed at a time. This does
253 // an automatic Acquire() on the records. The user must call Release() on 258 // an automatic Acquire() on the records. The user must call Release() on
254 // the returned object when it is finished with it. Ownership stays with 259 // the returned object when it is finished with it. Ownership stays with
255 // this allocator. 260 // this allocator.
256 PersistentSampleMapRecords* UseSampleMapRecords(uint64_t id, 261 PersistentSampleMapRecords* UseSampleMapRecords(uint64_t id,
257 const void* user); 262 const void* user);
258 263
259 // Create internal histograms for tracking memory use and allocation sizes 264 // Create internal histograms for tracking memory use and allocation sizes
260 // for allocator of |name| (which can simply be the result of Name()). This 265 // for allocator of |name| (which can simply be the result of Name()). This
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 440
436 // The location to which the data should be persisted. 441 // The location to which the data should be persisted.
437 FilePath persistent_location_; 442 FilePath persistent_location_;
438 443
439 DISALLOW_COPY_AND_ASSIGN(GlobalHistogramAllocator); 444 DISALLOW_COPY_AND_ASSIGN(GlobalHistogramAllocator);
440 }; 445 };
441 446
442 } // namespace base 447 } // namespace base
443 448
444 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ 449 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698