system_memory_stats_recorder.h 939 B

123456789101112131415161718192021222324252627
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_METRICS_SYSTEM_MEMORY_STATS_RECORDER_H_
  5. #define COMPONENTS_METRICS_SYSTEM_MEMORY_STATS_RECORDER_H_
  6. namespace metrics {
  7. // Record a memory size in megabytes, over a potential interval up to 32 GB.
  8. #define UMA_HISTOGRAM_LARGE_MEMORY_MB(name, sample) \
  9. UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 32768, 50)
  10. // The type of memory UMA stats to be recorded in RecordMemoryStats.
  11. enum RecordMemoryStatsType {
  12. // Right after the renderer for contents was killed.
  13. RECORD_MEMORY_STATS_CONTENTS_OOM_KILLED,
  14. // Right after the renderer for extensions was killed.
  15. RECORD_MEMORY_STATS_EXTENSIONS_OOM_KILLED,
  16. };
  17. void RecordMemoryStats(RecordMemoryStatsType type);
  18. } // namespace metrics
  19. #endif // COMPONENTS_METRICS_SYSTEM_MEMORY_STATS_RECORDER_H_