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 #include "components/memory_pressure/memory_pressure_stats_collector.h" | 5 #include "components/memory_pressure/memory_pressure_stats_collector.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "base/time/tick_clock.h" | 12 #include "base/time/tick_clock.h" |
13 | 13 |
14 namespace memory_pressure { | 14 namespace memory_pressure { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 using MemoryPressureLevel = MemoryPressureListener::MemoryPressureLevel; | 18 using MemoryPressureLevel = MemoryPressureListener::MemoryPressureLevel; |
19 | 19 |
20 // Converts a memory pressure level to an UMA enumeration value. | 20 // Converts a memory pressure level to an UMA enumeration value. |
21 MemoryPressureLevelUMA MemoryPressureLevelToUmaEnumValue( | 21 MemoryPressureLevelUMA MemoryPressureLevelToUmaEnumValue( |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 void MemoryPressureStatsCollector::ReportLevelChange( | 149 void MemoryPressureStatsCollector::ReportLevelChange( |
150 MemoryPressureLevel old_pressure_level, | 150 MemoryPressureLevel old_pressure_level, |
151 MemoryPressureLevel new_pressure_level) { | 151 MemoryPressureLevel new_pressure_level) { |
152 UMA_HISTOGRAM_ENUMERATION("Memory.PressureLevelChange", | 152 UMA_HISTOGRAM_ENUMERATION("Memory.PressureLevelChange", |
153 MemoryPressureLevelChangeToUmaEnumValue( | 153 MemoryPressureLevelChangeToUmaEnumValue( |
154 old_pressure_level, new_pressure_level), | 154 old_pressure_level, new_pressure_level), |
155 UMA_MEMORY_PRESSURE_LEVEL_CHANGE_COUNT); | 155 UMA_MEMORY_PRESSURE_LEVEL_CHANGE_COUNT); |
156 } | 156 } |
157 | 157 |
158 } // namespace memory_pressure | 158 } // namespace memory_pressure |
OLD | NEW |