Issue #2173335 by sun: Remove deprecated timer_* functions.
parent
6f3e437f91
commit
f3a7231356
|
@ -14,6 +14,7 @@
|
||||||
* @see batch_get()
|
* @see batch_get()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Drupal\Component\Utility\Timer;
|
||||||
use Drupal\Core\Batch\Percentage;
|
use Drupal\Core\Batch\Percentage;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@ -214,7 +215,7 @@ function _batch_process() {
|
||||||
// proceed with the same batch phase when a processing time of 1 second has
|
// proceed with the same batch phase when a processing time of 1 second has
|
||||||
// been exceeded.
|
// been exceeded.
|
||||||
if ($batch['progressive']) {
|
if ($batch['progressive']) {
|
||||||
timer_start('batch_processing');
|
Timer::start('batch_processing');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($current_set['start'])) {
|
if (empty($current_set['start'])) {
|
||||||
|
@ -277,7 +278,7 @@ function _batch_process() {
|
||||||
$queue = _batch_queue($current_set);
|
$queue = _batch_queue($current_set);
|
||||||
|
|
||||||
// If we are in progressive mode, break processing after 1 second.
|
// If we are in progressive mode, break processing after 1 second.
|
||||||
if ($batch['progressive'] && timer_read('batch_processing') > 1000) {
|
if ($batch['progressive'] && Timer::read('batch_processing') > 1000) {
|
||||||
// Record elapsed wall clock time.
|
// Record elapsed wall clock time.
|
||||||
$current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2);
|
$current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -222,30 +222,6 @@ const CONFIG_STAGING_DIRECTORY = 'staging';
|
||||||
*/
|
*/
|
||||||
define('DRUPAL_ROOT', dirname(dirname(__DIR__)));
|
define('DRUPAL_ROOT', dirname(dirname(__DIR__)));
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated as of Drupal 8.0.
|
|
||||||
* @see \Drupal\Component\Utility\Timer::start
|
|
||||||
*/
|
|
||||||
function timer_start($name) {
|
|
||||||
Timer::start($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated as of Drupal 8.0.
|
|
||||||
* @see \Drupal\Component\Utility\Timer::read
|
|
||||||
*/
|
|
||||||
function timer_read($name) {
|
|
||||||
return Timer::read($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated as of Drupal 8.0.
|
|
||||||
* @see \Drupal\Component\Utility\Timer::stop
|
|
||||||
*/
|
|
||||||
function timer_stop($name) {
|
|
||||||
return Timer::stop($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the appropriate configuration directory.
|
* Returns the appropriate configuration directory.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
namespace Drupal\views_ui;
|
namespace Drupal\views_ui;
|
||||||
|
|
||||||
|
use Drupal\Component\Utility\Timer;
|
||||||
use Drupal\views\Views;
|
use Drupal\views\Views;
|
||||||
use Drupal\Core\Entity\EntityStorageControllerInterface;
|
use Drupal\Core\Entity\EntityStorageControllerInterface;
|
||||||
use Drupal\views\ViewExecutable;
|
use Drupal\views\ViewExecutable;
|
||||||
|
@ -612,7 +613,7 @@ class ViewUI implements ViewStorageInterface {
|
||||||
|
|
||||||
$show_additional_queries = $config->get('ui.show.additional_queries');
|
$show_additional_queries = $config->get('ui.show.additional_queries');
|
||||||
|
|
||||||
timer_start('views_ui.preview');
|
Timer::start('views_ui.preview');
|
||||||
|
|
||||||
if ($show_additional_queries) {
|
if ($show_additional_queries) {
|
||||||
$this->startQueryCapture();
|
$this->startQueryCapture();
|
||||||
|
@ -626,7 +627,7 @@ class ViewUI implements ViewStorageInterface {
|
||||||
$this->endQueryCapture();
|
$this->endQueryCapture();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->render_time = timer_stop('views_ui.preview');
|
$this->render_time = Timer::stop('views_ui.preview');
|
||||||
|
|
||||||
views_ui_contextual_links_suppress_pop();
|
views_ui_contextual_links_suppress_pop();
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
use Drupal\Component\Utility\Timer;
|
||||||
use Drupal\Core\StreamWrapper\PublicStream;
|
use Drupal\Core\StreamWrapper\PublicStream;
|
||||||
|
|
||||||
const SIMPLETEST_SCRIPT_COLOR_PASS = 32; // Green.
|
const SIMPLETEST_SCRIPT_COLOR_PASS = 32; // Green.
|
||||||
|
@ -724,7 +725,7 @@ function simpletest_script_reporter_init() {
|
||||||
|
|
||||||
echo "Test run started:\n";
|
echo "Test run started:\n";
|
||||||
echo " " . format_date($_SERVER['REQUEST_TIME'], 'long') . "\n";
|
echo " " . format_date($_SERVER['REQUEST_TIME'], 'long') . "\n";
|
||||||
timer_start('run-tests');
|
Timer::start('run-tests');
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
echo "Test summary\n";
|
echo "Test summary\n";
|
||||||
|
@ -807,7 +808,7 @@ function simpletest_script_reporter_write_xml_results() {
|
||||||
*/
|
*/
|
||||||
function simpletest_script_reporter_timer_stop() {
|
function simpletest_script_reporter_timer_stop() {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
$end = timer_stop('run-tests');
|
$end = Timer::stop('run-tests');
|
||||||
echo "Test run duration: " . format_interval($end['time'] / 1000);
|
echo "Test run duration: " . format_interval($end['time'] / 1000);
|
||||||
echo "\n\n";
|
echo "\n\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue