API for outputting different formats from CPython sampling profiler
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Feature or enhancement
Proposal:
CPython 3.15 has statistical sampling profiler which currently only supports outputting
- pstats https://docs.python.org/3.15/library/profile.html#pstats.Stats
- collapsed format for flamegraphs https://github.com/python/cpython/blob/8d5c3341c538cd1a4192ca8a1536b2eed4b98c69/Lib/profiling/sampling/stack_collector.py#L24
Since it's still an early stage for the sampling profiler, I thought it would be nice to initiate discussion around how to support multiple different formats from the profiler.
- pprof
- OTel
are the formats that could potentially be added, but supporting those from CPython would introduce dependencies that might complicate building/testing and distributing CPython.
I'd like to suggest that CPython has an interface to support 3rd party collectors. What do you think?
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der Lektüre von Lib/profiling/sampling/stack_collector.py und der bestehenden Verarbeitung von pstats und collapsed-format, auf die im Issue verwiesen wird. Lesen Sie die verlinkte Discourse-Diskussion, bevor Sie eine Schnittstelle für Collector von Drittanbietern vorschlagen; als abgeschlossen würde eine vereinbarte API, klar definierte Grenzen der unterstützten Formate sowie ein Plan für die Build-, Test- und Distributionsbeschränkungen von CPython voraussetzen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- performance
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100