[NFR]: Add a direct push API to collectors

Fermée
#44 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@niden y travaille déjà.

Depuis le 3/11/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

enhancement
Summary

Most collectors can receive data only through their event listeners. A host that has other data sources, or no events manager, cannot feed them. Add public methods to these collectors. Behavior does not change.

Current state
  • ExceptionsCollector::addThrowable() already exists and does not change.
  • DatabaseCollector, ViewCollector, RouteCollector and CacheCollector write their data only inside subscribe() closures.
Proposed direction

Follow the addThrowable() naming. The existing listeners call the new methods.

  • DatabaseCollector: a start method and a finish method that takes the SQL and the bindings. The collector measures the time.
  • ViewCollector: a start method that takes the path and a finish method. The pending stack stays, so nested partials are timed correctly.
  • CacheCollector: a method that takes the operation and the key.
  • RouteCollector: a method that takes the panel values, or a callable that returns them. The collector calls the callable at collect time. This keeps the MVC read at collect time, because the MVC router is not fully resolved when router:matchedRoute fires. After #15, the collector needs no Phalcon\Mvc import.
Acceptance
  • Each collector gets data through its new method, with no events manager.
  • The existing collector tests pass with the same expected results.
  • Tests pass with full coverage. phpcs and phpstan pass.
Part of

#13

Langage dominant
PHP
Étoiles
6
Forks
3
Merge moyen
5 h 50 min
PR mergées (30 j)
18

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Issues similaires

Plus d'issues PHP

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.