OLD | NEW |
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 Loading... |
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. Don't call this on a "global" |
| 254 // allocator because histograms created there will already be in the SR. |
| 255 void MergeHistogramToStatisticsRecorder(HistogramBase* histogram); |
| 256 |
251 // Returns the object that manages the persistent-sample-map records for a | 257 // 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 | 258 // 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 | 259 // 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 | 260 // the returned object when it is finished with it. Ownership stays with |
255 // this allocator. | 261 // this allocator. |
256 PersistentSampleMapRecords* UseSampleMapRecords(uint64_t id, | 262 PersistentSampleMapRecords* UseSampleMapRecords(uint64_t id, |
257 const void* user); | 263 const void* user); |
258 | 264 |
259 // Create internal histograms for tracking memory use and allocation sizes | 265 // Create internal histograms for tracking memory use and allocation sizes |
260 // for allocator of |name| (which can simply be the result of Name()). This | 266 // 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 Loading... |
435 | 441 |
436 // The location to which the data should be persisted. | 442 // The location to which the data should be persisted. |
437 FilePath persistent_location_; | 443 FilePath persistent_location_; |
438 | 444 |
439 DISALLOW_COPY_AND_ASSIGN(GlobalHistogramAllocator); | 445 DISALLOW_COPY_AND_ASSIGN(GlobalHistogramAllocator); |
440 }; | 446 }; |
441 | 447 |
442 } // namespace base | 448 } // namespace base |
443 | 449 |
444 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ | 450 #endif // BASE_METRICS_HISTOGRAM_PERSISTENCE_H_ |
OLD | NEW |