Chromium Code Reviews| Index: components/arc/metrics/arc_low_memory_killer_monitor.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_low_memory_killer_monitor.cc b/components/arc/metrics/arc_low_memory_killer_monitor.cc |
| similarity index 91% |
| rename from chrome/browser/chromeos/arc/arc_low_memory_killer_monitor.cc |
| rename to components/arc/metrics/arc_low_memory_killer_monitor.cc |
| index 4976cf085255b745811628f2f831ce7ed3d924b9..2f46fe12fb6087094592cf267bdfe6f4ad5bb93c 100644 |
| --- a/chrome/browser/chromeos/arc/arc_low_memory_killer_monitor.cc |
| +++ b/components/arc/metrics/arc_low_memory_killer_monitor.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/chromeos/arc/arc_low_memory_killer_monitor.h" |
| +#include "components/arc/metrics/arc_low_memory_killer_monitor.h" |
| #include <errno.h> |
| #include <fcntl.h> |
| @@ -72,6 +72,7 @@ void ArcLowMemoryKillerMonitor::Run( |
| int64_t timestamp, last_timestamp = -1; |
| const TimeDelta kMaxTimeDelta = |
| TimeDelta::FromSeconds(MAX_LOWMEMORYKILL_TIME_SECS); |
| + int oom_kills = 0; |
| while (fgets(buf, kMaxBufSize, kmsg_handle)) { |
| if (worker_pool->IsShutdownInProgress()) { |
| @@ -99,11 +100,15 @@ void ArcLowMemoryKillerMonitor::Run( |
| time_delta = TimeDelta::FromMicroseconds(timestamp - last_timestamp); |
| } |
| last_timestamp = timestamp; |
| + UMA_HISTOGRAM_LOWMEMORYKILL_TIMES( |
| + "Arc.LowMemoryKiller.TimeDelta", time_delta); |
| + |
| + ++oom_kills; |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
|
hidehiko
2016/03/24 08:11:21
Shouldn't this be out of the while loop?
If it is
cylee1
2016/03/24 14:36:06
Yes it's intentional. One of the reason is this de
|
| + "Arc.LowMemoryKiller.Count", oom_kills, 1, 1000, 1001); |
| - UMA_HISTOGRAM_MEMORY_KB("ArcRuntime.LowMemoryKiller.FreedSize", |
| + UMA_HISTOGRAM_MEMORY_KB("Arc.LowMemoryKiller.FreedSize", |
| freed_size); |
| - UMA_HISTOGRAM_LOWMEMORYKILL_TIMES( |
| - "ArcRuntime.LowMemoryKiller.TimeDelta", time_delta); |
| } |
| } |
| } |