PEP 454: replace Statistic.key with Statistic.traceback
This commit is contained in:
parent
f96659cba7
commit
3ba7d9323f
45
pep-0454.txt
45
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:
|
||||
|
||||
|
|
Loading…
Reference in New Issue