public final function getResourceStats(): ?array
    {
        $return = null;

        $resourceType = $this->resource->getType();
        $resourceObject = $this->resource->getObject();
        if ($resourceType == Resource::TYPE_MYSQL_LINK) {
            $result = $resourceObject->query('SHOW SESSION STATUS');
            while ($row = $result->fetch_assoc()) {
                $return[strtolower($row['Variable_name'])] = $row['Value'];
            }
            $result->free();
        } elseif ($resourceType == Resource::TYPE_PGSQL_LINK) {
            $result = pg_query($resourceObject, sprintf(
                "SELECT * FROM pg_stat_activity WHERE usename = '%s'",
                    pg_escape_string($resourceObject, $this->config['username'])
            ));
            $resultArray = pg_fetch_all($result);
            if (isset($resultArray[0])) {
                $return = $resultArray[0];
            }
            pg_free_result($result);
        }

        return $return;
    }