OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_MEMORY_SYSTEM_MEMORY_STATS_RECORDER_H_ | 5 #ifndef COMPONENTS_METRICS_SYSTEM_MEMORY_STATS_RECORDER_H_ |
6 #define CHROME_BROWSER_MEMORY_SYSTEM_MEMORY_STATS_RECORDER_H_ | 6 #define COMPONENTS_METRICS_SYSTEM_MEMORY_STATS_RECORDER_H_ |
7 | 7 |
8 namespace memory { | 8 namespace metrics { |
9 | 9 |
10 // Record a memory size in megabytes, over a potential interval up to 32 GB. | 10 // Record a memory size in megabytes, over a potential interval up to 32 GB. |
11 #define UMA_HISTOGRAM_LARGE_MEMORY_MB(name, sample) \ | 11 #define UMA_HISTOGRAM_LARGE_MEMORY_MB(name, sample) \ |
12 UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 32768, 50) | 12 UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 32768, 50) |
13 | 13 |
14 // The type of memory UMA stats to be recorded in RecordMemoryStats. | 14 // The type of memory UMA stats to be recorded in RecordMemoryStats. |
15 enum RecordMemoryStatsType { | 15 enum RecordMemoryStatsType { |
16 // When a tab was discarded. | 16 // When a tab was discarded. |
17 RECORD_MEMORY_STATS_TAB_DISCARDED, | 17 RECORD_MEMORY_STATS_TAB_DISCARDED, |
18 | 18 |
19 // Right after the renderer for contents was killed. | 19 // Right after the renderer for contents was killed. |
20 RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED, | 20 RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED, |
21 | 21 |
22 // Right after the renderer for extensions was killed. | 22 // Right after the renderer for extensions was killed. |
23 RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED, | 23 RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED, |
24 }; | 24 }; |
25 | 25 |
26 void RecordMemoryStats(RecordMemoryStatsType type); | 26 void RecordMemoryStats(RecordMemoryStatsType type); |
27 | 27 |
28 } // namespace memory | 28 } // namespace metrics |
29 | 29 |
30 #endif // CHROME_BROWSER_MEMORY_SYSTEM_MEMORY_STATS_RECORDER_H_ | 30 #endif // COMPONENTS_METRICS_SYSTEM_MEMORY_STATS_RECORDER_H_ |
OLD | NEW |