Skip to content

Instantly share code, notes, and snippets.

@shoman4eg
Last active January 31, 2025 11:15
Show Gist options
  • Select an option

  • Save shoman4eg/be959e097007c3790e0e09c3f05f5d2a to your computer and use it in GitHub Desktop.

Select an option

Save shoman4eg/be959e097007c3790e0e09c3f05f5d2a to your computer and use it in GitHub Desktop.
<?php
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
$application = \Bitrix\Main\Application::getInstance();
$connection = $application->getConnection();
$connection->startTracker();
$sqlTracker = $connection->getTracker();
// Сюда вставить sql запрос.
var_dump($sqlTracker->getTime());
var_dump($sqlTracker->getCounter());
var_dump($sqlTracker->getQueries());
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment