Skip to content

Own Sphinx-Extension for GarbageCollector Stats #23

@danwos

Description

@danwos

Sphinx-Performance should also provide a Sphinx extension and maybe builder, so that we can get insights of the Sphinx-Build.

The first feature would be to collect the stats of the Garbage collector.
This code can be used:

import gc
stats = gc.get_stats()

print('** Python Garbage Collector stats **')
for index, col in enumerate(stats):
    for key, value in col.items():
        print(f'{index}.{key}: {value}')
    print('')

The output would like like this at the end of the Sphinx build:

** Python Garbage Collector stats **
0.collections: 492
0.collected: 2738
0.uncollectable: 0

1.collections: 44
1.collected: 769
1.uncollectable: 0

2.collections: 4
2.collected: 32384
2.uncollectable: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions