telemetry.timeline.memory_dump_event
index
telemetry/timeline/memory_dump_event.py

# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

 
Modules
       
posixpath
re
telemetry.timeline.event

 
Classes
       
__builtin__.object
GlobalMemoryDump
MemoryBucket
MmapCategory
telemetry.timeline.event.TimelineEvent(__builtin__.object)
ProcessMemoryDumpEvent

 
class GlobalMemoryDump(__builtin__.object)
    Object to aggregate individual process dumps with the same dump id.
 
Args:
  process_dumps: A sequence of ProcessMemoryDumpEvent objects, all sharing
      the same global dump id.
 
Attributes:
  dump_id: A string identifying this dump.
  has_mmaps: True if the memory dump has mmaps information. If False then
      GetMemoryUsage will report all zeros.
 
  Methods defined here:
GetMemoryUsage(self)
Get the aggregated memory usage over all processes in this dump.
IterProcessMemoryDumps(self)
__init__(self, process_dumps)
__repr__(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
duration
end
start

 
class MemoryBucket(__builtin__.object)
    Simple object to hold and aggregate memory values.
 
  Methods defined here:
AddRegion(self, byte_stats)
GetValue(self, name)
__init__(self)
__repr__(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class MmapCategory(__builtin__.object)
     Methods defined here:
GetMatchingChild(self, mapped_file)
Get the first matching sub-category for a given mapped file.
 
Returns None if the category has no children, or the DefaultCategory if
it does have children but none of them match.
Match(self, mapped_file)
Test whether a mapped file matches this category.
__init__(self, name, file_pattern, children=None)
A (sub)category for classifying memory maps.
 
Args:
  name: A string to identify the category.
  file_pattern: A regex pattern, the category will aggregate memory usage
      for all mapped files matching this pattern.
  children: A list of MmapCategory objects, used to sub-categorize memory
      usage.

Class methods defined here:
DefaultCategory(cls) from __builtin__.type
An implicit 'Others' match-all category with no children.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ProcessMemoryDumpEvent(telemetry.timeline.event.TimelineEvent)
    A memory dump event belonging to a single timeline.Process object.
 
It's a subclass of telemetry's TimelineEvent so it can be included in
the stream of events contained in timeline.model objects, and have its
timing correlated with that of other events in the model.
 
Properties:
  dump_id: A string to identify events belonging to the same global dump.
  process: The timeline.Process object that owns this memory dump event.
  has_mmaps: True if the memory dump has mmaps information. If False then
      GetMemoryUsage will report all zeros.
 
 
Method resolution order:
ProcessMemoryDumpEvent
telemetry.timeline.event.TimelineEvent
__builtin__.object

Methods defined here:
GetMemoryBucket(self, path)
Return the MemoryBucket associated with a category path.
 
An empty bucket will be created if the path does not already exist.
 
path: A string with path in the classification tree, e.g.
    '/Android/Java runtime/Cache'. Note: no trailing slash, except for
    the root path '/'.
GetMemoryUsage(self)
Get a dictionary with the memory usage of this process.
GetMemoryValue(self, category_path, discount_tracing=False)
Return a specific value from within a MemoryBucket.
 
category_path: A string composed of a path in the classification tree,
    followed by a '.', followed by a specific bucket value, e.g.
    '/Android/Java runtime/Cache.private_dirty_resident'.
discount_tracing: A boolean indicating whether the returned value should
    be discounted by the resident size of the tracing allocator.
__init__(self, process, event)
__repr__(self)

Data descriptors defined here:
process_name

Data descriptors inherited from telemetry.timeline.event.TimelineEvent:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
end
has_thread_timestamps
thread_end
Thread-specific CPU time when this event ended.
 
May be None if the trace event didn't have thread time data.

 
Data
        BUCKET_ATTRS = {'private_clean_resident': 'pc', 'private_dirty_resident': 'pd', 'proportional_resident': 'pss', 'shared_clean_resident': 'sc', 'shared_dirty_resident': 'sd', 'swapped': 'sw'}
MMAPS_METRICS = {'mmaps_ashmem': ('/Android/Ashmem.proportional_resident', False), 'mmaps_java_heap': ('/Android/Java runtime/Spaces.proportional_resident', False), 'mmaps_native_heap': ('/Native heap.proportional_resident', True), 'mmaps_overall_pss': ('/.proportional_resident', True), 'mmaps_private_dirty': ('/.private_dirty_resident', True)}
ROOT_CATEGORY = <telemetry.timeline.memory_dump_event.MmapCategory object>