Skip to content

Commit a80ee1f

Browse files
Add a command doc for use in the handbook (#178)
1 parent f6d502f commit a80ee1f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/Command.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@
55
use WP_CLI;
66
use WP_CLI\Utils;
77

8+
/**
9+
* Quickly identify what's slow with WordPress.
10+
*
11+
* ## EXAMPLES
12+
*
13+
* # See an overview for each stage of the load process.
14+
* $ wp profile stage --fields=stage,time,cache_ratio
15+
* +------------+---------+-------------+
16+
* | stage | time | cache_ratio |
17+
* +------------+---------+-------------+
18+
* | bootstrap | 0.7994s | 93.21% |
19+
* | main_query | 0.0123s | 94.29% |
20+
* | template | 0.792s | 91.23% |
21+
* +------------+---------+-------------+
22+
* | total (3) | 1.6037s | 92.91% |
23+
* +------------+---------+-------------+
24+
*
25+
* # Dive into hook performance for a given stage.
26+
* $ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight
27+
* +--------------------------+---------+-------------+
28+
* | hook | time | cache_ratio |
29+
* +--------------------------+---------+-------------+
30+
* | muplugins_loaded:before | 0.2335s | 40% |
31+
* | muplugins_loaded | 0.0007s | 50% |
32+
* | plugins_loaded:before | 0.2792s | 77.63% |
33+
* | plugins_loaded | 0.1502s | 100% |
34+
* | after_setup_theme:before | 0.068s | 100% |
35+
* | init | 0.2643s | 96.88% |
36+
* | wp_loaded:after | 0.0377s | |
37+
* +--------------------------+---------+-------------+
38+
* | total (7) | 1.0335s | 77.42% |
39+
* +--------------------------+---------+-------------+
40+
*/
841
class Command {
942

1043
/**

0 commit comments

Comments
 (0)