Server IP : 10.106.20.8  /  Your IP : 216.73.216.148
Web Server : Apache
System : Linux webm008.cluster106.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : sixiemesrc ( 611999)
PHP Version : 8.0.30
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/sixiemesrc/new/wp-content/languages/../plugins/query-monitor/collectors/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/sixiemesrc/new/wp-content/languages/../plugins/query-monitor/collectors/db_callers.php
<?php declare(strict_types = 1);
/**
 * Database query calling function collector.
 *
 * @package query-monitor
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * @extends QM_DataCollector<QM_Data_DB_Callers>
 */
class QM_Collector_DB_Callers extends QM_DataCollector {

	public $id = 'db_callers';

	public function get_storage(): QM_Data {
		return new QM_Data_DB_Callers();
	}

	/**
	 * @return void
	 */
	public function process() {
		/** @var QM_Collector_DB_Queries|null $dbq */
		$dbq = QM_Collectors::get( 'db_queries' );

		if ( $dbq ) {
			/** @var QM_Data_DB_Queries $dbq_data */
			$dbq_data = $dbq->get_data();

			$this->data->times = $dbq_data->times;
			QM_Util::rsort( $this->data->times, 'ltime' );

			$this->data->types = $dbq_data->types;
		}

	}

}

/**
 * @param array<string, QM_Collector> $collectors
 * @param QueryMonitor $qm
 * @return array<string, QM_Collector>
 */
function register_qm_collector_db_callers( array $collectors, QueryMonitor $qm ) {
	$collectors['db_callers'] = new QM_Collector_DB_Callers();
	return $collectors;
}

add_filter( 'qm/collectors', 'register_qm_collector_db_callers', 20, 2 );