MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

iMetricsProvider

MMO\admin\monitoring · 1 symbol · generated 27 Oct 2026

interface

iMetricsProvider

iMetricsProvider.php:20

What an application counts about itself for the hub (MetricsController): its users, its documents, its jobs waiting, a queue's age -- whatever says it is healthy that no server metric can.

interface MMO\admin\monitoring\iMetricsProvider
Namespace
MMO\admin\monitoring
A provider is a class the application names in MetricsController's `providers`. It is built once per request, and should answer fast: the hub asks every few minutes.
class UsersMetrics implements iMetricsProvider { public function collect(Metrics $metrics): void { $metrics->add('users.active', \MMO\get('repo')->getCollection('users')->count(['active' => true])); $metrics->check('mail queue', ($queued = count(glob('/var/spool/postfix/deferred'))) > 100? 'warning' : 'ok', "$queued deferred"); } }

Methods1