• Модуль: perfmon
  • Путь к файлу: ~/bitrix/modules/perfmon/classes/general/query_stat.php
  • Класс: CPerfQueryStat
  • Вызов: CPerfQueryStat::_get_stat
static function _get_stat($table, $column = "", $value = "")
{
	global $DB;
	$table = trim($table, "`");
	$column = trim($column, "`");

	if ($column == "")
	{
		$rs = $DB->Query("
			select *
			from b_perf_tab_stat
			where TABLE_NAME = '".$DB->ForSQL($table)."'
		");
	}
	else
	{
		if (isset($value))
			$where = ($value == ""? "": "AND VALUE = '".$DB->ForSQL($value, 100)."'");
		else
			$where = "AND VALUE IS NULL";

		$rs = $DB->Query("
			select *
			from b_perf_tab_column_stat
			where TABLE_NAME = '".$DB->ForSQL($table)."'
			AND COLUMN_NAME = '".$DB->ForSQL($column)."'
			".$where."
		");
	}

	return $rs->Fetch();
}