Add streaming to `profiling.sampling`
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 77.2k
- Forks
- 35.9k
- Métriques de merge des PR
- Métriques de PR en attente
Description
Feature or enhancement
Proposal:
Right now, profiling.sampling has roughly two modes: live with the TUI, and snapshot-at-the-end (except binary? but see the note below.) There's nothing that streams the data continously as it comes. This would be ideal for long-running headless profiling.
This one is less defined than #145411, so there are more open questions:
- Should it stream raw or agreggate data? What should be the window?
- What should be the format? Unfortunately, from what I checked the current binary format is not really well-suited for streaming, as it saves the dictionaries only on finalize.
- What should be the transport layers for streaming?
- What should be the types of messages?
- What should be the configuration flags?
- How the backpressure should be handled? Should it drop the oldest? All the oldest?
My hunch is:
- support both raw and aggregate and assume that aggregate is just a different message type.
- start with something simple as JSONL
- I have mixed feelings about the transport layer. The stdout sounds great on paper but it's a mixed-use channel right now and there's a question around blocking by slower consumers. Maybe for debugging? Unix socket is good but not perfectly portable
- as for backpressure, I would just drop the oldest by default, but only the
raw,aggandheartbeatmessages.
For starters:
--stream unix:/tmp/tachyon-stream.sockor--stream file:/tmp/tachyon-stream.sock(later:--stream tcp:127.0.0.1:1234)--stream-types meta|str_def|frame_def|raw|agg:5s|loss|heartbeat|end|error(comma separated; note theagg:5shere; we it could be extended toheartbeat:1setc. in the future)--stream-format jsonl
Then, in the next phases we could think of --stream-drop-policy etc.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par lire l’implémentation de profiling.sampling et la discussion associée dans l’issue #145411. Examinez les types de stream proposés, le format JSONL, les transports et les questions de backpressure avant de restreindre la conception. La tâche est terminée lorsqu’un périmètre de streaming convenu et une configuration prenant en charge le profiling headless de longue durée sont définis.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- performance
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- Calme
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100