Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Improve quality of event performance tracking

オープン
#8 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php

調査の方向性

まず、issue で説明されているイベントデータコレクターと October core の wildcard-listener 実装を見つけます。リスナーの優先度がどのように並べられているかを確認し、次に、測定がイベント実行全体にわたっていることと、収集したタイミングデータが各イベントについて記録されていることを検証します。

索引モデルが issue の本文から書いたものです。

説明

help wanted Type: Enhancement

Remake of https://github.com/rainlab/debugbar-plugin/issues/42 by @LukeTowers.

Right now performance / timing tracking on events uses the difference between when the last event was fired to when the current event was fired to say how long a given event took to process. This is obviously wildly inaccurate and unhelpful, so it would be better if we could instead implement our own event data collector that actually tracked how long a given event was taking to execute by hooking one wildcard listener as the highest priority listener (with PHP_INT_MAX) and another wildcard listener as the lowest priority listener (with PHP_INT_MIN) and then recording the timing difference between those two listeners being fired.

This would require a change being made to the October core as currently wildcard listeners don't support subscribing to events with priority, and even if they did you'd still have to ensure that they were added to the priority stream of the non-wildcard listeners correctly.

Something roughly like the following:

$events->listen('*', [$this, 'onWildcardEventStart'], PHP_INT_MAX);
    $events->listen('*', [$this, 'onWildcardEventEnd'], PHP_INT_MIN);
}

protected $timings = [];

public function onWildCardEventStart($name = null, $data = [])
{
    if (empty($name)) { return; }
    $this->timings[$name] = microtime(true);
}
public function onWildCardEventEnd($name = null, $data = [])
{
    if (empty($name)) { return; }
    $this->addMeasure($name, $this->timings[$name], microtime(true), $this->prepareParams($data));
}
主要言語
PHP
スター
12
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wintercms/wn-debugbar-plugin のほかの issue

wintercms/wn-debugbar-plugin の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。