> For the complete documentation index, see [llms.txt](https://sw-fw-less.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sw-fw-less.gitbook.io/project/other-1/events.md).

# Events

### Config Example

```
//Events
'events' => [
    'redis:pool:change' => [
        function ($event) {
            $count = $event->getData('count');

            if (\App\components\Config::get('redis.report_pool_change')) {
                if (extension_loaded('swoole')) {
                    \App\components\utils\swoole\Counter::incr('monitor:pool:redis', $count);
                }
            }
        },
    ],
    'mysql:pool:change' => [
        function ($event) {
            $count = $event->getData('count');

            if (\App\components\Config::get('mysql.report_pool_change')) {
                if (extension_loaded('swoole')) {
                    \App\components\utils\swoole\Counter::incr('monitor:pool:mysql', $count);
                }
            }
        },
    ],
    'amqp:pool:change' => [
        function ($event) {
            $count = $event->getData('count');

            if (\App\components\Config::get('amqp.report_pool_change')) {
                if (extension_loaded('swoole')) {
                    \App\components\utils\swoole\Counter::incr('monitor:pool:amqp', $count);
                }
            }
        },
    ],
]
```
