From 3ba7d9323f498f04ca75db984a7b40e303e55437 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 5 Nov 2013 22:04:26 +0100 Subject: [PATCH] PEP 454: replace Statistic.key with Statistic.traceback --- pep-0454.txt | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/pep-0454.txt b/pep-0454.txt index 1030caf73..51e30e95f 100644 --- a/pep-0454.txt +++ b/pep-0454.txt @@ -134,6 +134,17 @@ Main functions See also ``start()`` and ``stop()`` functions. +``start()`` function: + + Start tracing Python memory allocations. + + The function installs hooks on Python memory allocators. These hooks + have important overhead in term of performances and memory usage: + see `Filter functions`_ to limit the overhead. + + See also ``stop()`` and ``is_tracing()`` functions. + + ``stop()`` function: Stop tracing Python memory allocations and clear traces of memory @@ -148,17 +159,6 @@ Main functions See also ``start()`` and ``is_tracing()`` functions. -``start()`` function: - - Start tracing Python memory allocations. - - The function installs hooks on Python memory allocators. These hooks - have important overhead in term of performances and memory usage: - see `Filter functions`_ to limit the overhead. - - See also ``stop()`` and ``is_tracing()`` functions. - - ``take_snapshot()`` function: Take a snapshot of traces of memory blocks allocated by Python using @@ -384,18 +384,18 @@ Snapshot See also ``dump()``. -``statistics(key_type: str, cumulative: bool=False, compare_to=None)`` method: +``statistics(group_by: str, cumulative: bool=False, compare_to=None)`` method: Get statistics as a sorted list of ``Statistic`` instances, grouped - by *key_type*: + by *group_by*: - ===================== ======================== ================================================ - key_type description type - ===================== ======================== ================================================ - ``'filename'`` filename ``str`` - ``'lineno'`` filename and line number ``(filename: str, lineno: int)`` - ``'traceback'`` traceback tuple of ``(filename: str, lineno: int)`` tuples - ===================== ======================== ================================================ + ===================== ======================== + group_by description + ===================== ======================== + ``'filename'`` filename + ``'lineno'`` filename and line number + ``'traceback'`` traceback + ===================== ======================== If *cumulative* is ``True``, cumulate size and count of memory blocks of all frames of the traceback of a trace, not only the most @@ -442,10 +442,9 @@ Statistic ``Snapshot.statistics()`` returns a list of ``Statistic`` instances. -``key`` attribute: +``traceback`` attribute: - Key identifying the statistic. The key type depends on the - *key_type* parameter of the ``Snapshot.statistics()`` method. + Tuple of ``(filename: str, lineno: int)`` tuples. ``count`` attribute: