mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-18 06:11:48 +08:00
Add a command doc for use in the handbook (#178)
This commit is contained in:
parent
f6d502f15a
commit
a80ee1f2fb
1 changed files with 33 additions and 0 deletions
|
@ -5,6 +5,39 @@ namespace WP_CLI\Profile;
|
|||
use WP_CLI;
|
||||
use WP_CLI\Utils;
|
||||
|
||||
/**
|
||||
* Quickly identify what's slow with WordPress.
|
||||
*
|
||||
* ## EXAMPLES
|
||||
*
|
||||
* # See an overview for each stage of the load process.
|
||||
* $ wp profile stage --fields=stage,time,cache_ratio
|
||||
* +------------+---------+-------------+
|
||||
* | stage | time | cache_ratio |
|
||||
* +------------+---------+-------------+
|
||||
* | bootstrap | 0.7994s | 93.21% |
|
||||
* | main_query | 0.0123s | 94.29% |
|
||||
* | template | 0.792s | 91.23% |
|
||||
* +------------+---------+-------------+
|
||||
* | total (3) | 1.6037s | 92.91% |
|
||||
* +------------+---------+-------------+
|
||||
*
|
||||
* # Dive into hook performance for a given stage.
|
||||
* $ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight
|
||||
* +--------------------------+---------+-------------+
|
||||
* | hook | time | cache_ratio |
|
||||
* +--------------------------+---------+-------------+
|
||||
* | muplugins_loaded:before | 0.2335s | 40% |
|
||||
* | muplugins_loaded | 0.0007s | 50% |
|
||||
* | plugins_loaded:before | 0.2792s | 77.63% |
|
||||
* | plugins_loaded | 0.1502s | 100% |
|
||||
* | after_setup_theme:before | 0.068s | 100% |
|
||||
* | init | 0.2643s | 96.88% |
|
||||
* | wp_loaded:after | 0.0377s | |
|
||||
* +--------------------------+---------+-------------+
|
||||
* | total (7) | 1.0335s | 77.42% |
|
||||
* +--------------------------+---------+-------------+
|
||||
*/
|
||||
class Command {
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue