public static function process_event(\core\event\base $event) {
        if (!get_config('tool_monitor', 'enablemonitor')) {
            return; // The tool is disabled. Nothing to do.
        }

        if (empty(self::$instance)) {
            self::$instance = new static();
            // Register shutdown handler - this is useful for buffering, processing events, etc.
            \core_shutdown_manager::register_function(array(self::$instance, 'process_buffer'));
        }

        self::$instance->buffer_event($event);

        if (PHPUNIT_TEST) {
            // Process buffer after every event when unit testing.
            self::$instance->process_buffer();

        }
    }