OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_MEMORY_MEMORY_KILLS_HISTOGRAM_H_ |
| 6 #define CHROME_BROWSER_MEMORY_MEMORY_KILLS_HISTOGRAM_H_ |
| 7 |
| 8 #include "base/metrics/histogram.h" |
| 9 #include "base/time/time.h" |
| 10 |
| 11 namespace memory { |
| 12 |
| 13 constexpr base::TimeDelta kMaxMemoryKillTimeDelta = |
| 14 base::TimeDelta::FromSeconds(30); |
| 15 |
| 16 } // namespace memory |
| 17 |
| 18 // Use this macro to report elapsed time since last Memory kill event. |
| 19 // Must be a macro as the underlying HISTOGRAM macro creates static variables. |
| 20 #define UMA_HISTOGRAM_MEMORY_KILL_TIME_INTERVAL(name, sample) \ |
| 21 UMA_HISTOGRAM_CUSTOM_TIMES( \ |
| 22 name, sample, base::TimeDelta::FromMilliseconds(1), \ |
| 23 ::memory::kMaxMemoryKillTimeDelta, 50) |
| 24 |
| 25 #endif // CHROME_BROWSER_MEMORY_MEMORY_KILLS_HISTOGRAM_H_ |
OLD | NEW |