CakeFest 2024: The Official CakePHP Conference

xhprof_enable

(PECL xhprof >= 0.9.0)

xhprof_enableInicia perfil xhprof

Descripción

xhprof_enable(int $flags = 0, array $options = ?): void

Inicia perfiles xhprof.

Parámetros

flags

Flags opcionales para añadir información adicional a la creación de perfiles. Véase las constantes XHprof Para obtener más información acerca de estos flags, p. ej., XHPROF_FLAGS_MEMORY para permitir perfiles de memoria.

options

Un array de opciones opcionales, es decir, la opción 'ignored_functions' para pasar en las funciones que se ignoraron durante el perfilado.

Valores devueltos

null

Historial de cambios

Versión Descripción
PECL xhprof 0.9.2 El parámetro opcional options fué agregado.

Ejemplos

Ejemplo #1 Ejemplos de xhprof_enable()

<?php
// 1. tiempo transcurrido + memoria + perfiles CPU; e ignorar las funciones integradas (internas)
xhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);

// 2. perfil tiempo transcurrido; ignorando call_user_func* durante el perfilado
xhprof_enable(
0,
array(
'ignored_functions' => array('call_user_func',
'call_user_func_array')));

// 3. tiempo transcurrido + perfil de memoria; ignorando call_user_func* durante el perfilado
xhprof_enable(
XHPROF_FLAGS_MEMORY,
array(
'ignored_functions' => array('call_user_func',
'call_user_func_array')));
?>

Ver también

add a note

User Contributed Notes 1 note

up
5
Vladimir Kovpak
8 years ago
<?php

// You can optionally profile CPU time and/or memory usage:
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
To Top