diff --git a/Classes/EventListener/FileProcessingEventListener.php b/Classes/EventListener/FileProcessingEventListener.php new file mode 100644 index 0000000..7567b52 --- /dev/null +++ b/Classes/EventListener/FileProcessingEventListener.php @@ -0,0 +1,29 @@ +getProcessedFile()->isProcessed()) { + $this->stopWatch?->stopIfNot(); + $this->stopWatch = TimingUtility::stopWatch('fileProcessing', $event->getProcessedFile()->getName()); + } + } + + public function after(AfterFileProcessingEvent $event): void + { + $this->stopWatch?->stopIfNot(); + $this->stopWatch = null; + } +} diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 9828303..5382584 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -39,10 +39,23 @@ services: identifier: kanti/server-timing/mail-event-listener event: TYPO3\CMS\Core\Mail\Event\AfterMailerSentMessageEvent method: stop - Kanti\ServerTiming\EventListener\BootCompletedEventListener: tags: - name: event.listener identifier: kanti/server-timing/boot-completed-event-listener event: TYPO3\CMS\Core\Core\Event\BootCompletedEvent + + Kanti\ServerTiming\EventListener\FileProcessingEventListener: + tags: + - + name: event.listener + identifier: kanti/server-timing/file-processing + event: TYPO3\CMS\Core\Resource\Event\BeforeFileProcessingEvent + method: before + + - + name: event.listener + identifier: kanti/server-timing/file-processing + event: TYPO3\CMS\Core\Resource\Event\AfterFileProcessingEvent + method: after diff --git a/README.md b/README.md index 0bf2f69..c1e64cd 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ at the moment there is nothing to configure - `mail`: shows the mails that are send (only TYPO3 >=12) - `dataP`: Shows the DataProcessors that were executed - `extbase`: show all Extbase dispatches, (forwards are included in the original action call) +- `fileProcessing`: show all file processing calls - `http.client`: external API calls are measured if they use the official TYPO3 `RequestFactory` or the `GuzzleClientFactory`) > if a measurement key has more than 4 entries, they will get combined into one total time with a count. diff --git a/composer.json b/composer.json index 6d762a9..dbe0e09 100644 --- a/composer.json +++ b/composer.json @@ -40,14 +40,14 @@ }, "config": { "allow-plugins": { - "typo3/class-alias-loader": true, - "typo3/cms-composer-installers": true, - "phpro/grumphp": true, - "pluswerk/grumphp-config": true, + "ergebnis/composer-normalize": true, "infection/extension-installer": true, + "php-http/discovery": false, + "phpro/grumphp": true, "phpstan/extension-installer": true, - "ergebnis/composer-normalize": true, - "php-http/discovery": false + "pluswerk/grumphp-config": true, + "typo3/class-alias-loader": true, + "typo3/cms-composer-installers": true } }, "extra": {