1 The following are examples of php_calldist.d.
3 This script traces the elapsed time of PHP functions and prints a report
4 containing distribution plots per subroutine. Here it traces the example program
8 Tracing... Hit Ctrl-C to end.
11 Exclusive function elapsed times (us),
12 func_abc.php, func, func_a
13 value ------------- Distribution ------------- count
15 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
18 func_abc.php, func, func_b
19 value ------------- Distribution ------------- count
21 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
24 func_abc.php, func, func_c
25 value ------------- Distribution ------------- count
27 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
30 func_abc.php, func, sleep
31 value ------------- Distribution ------------- count
33 524288 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
37 Inclusive function elapsed times (us),
38 func_abc.php, func, func_c
39 value ------------- Distribution ------------- count
41 524288 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
44 func_abc.php, func, func_b
45 value ------------- Distribution ------------- count
47 1048576 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
50 func_abc.php, func, sleep
51 value ------------- Distribution ------------- count
53 524288 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3
56 func_abc.php, func, func_a
57 value ------------- Distribution ------------- count
59 2097152 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
62 In total, 3 subroutines were called, one each of func_a(), func_b() and
63 func_c(), and sleep was called 3 times. You can see this reflected in the
64 "count" column on the right.
66 The exclusive subroutine elapsed times show that each subroutine spent
67 between 256 and 512 microseconds. This time excludes the time spent in
70 The inclusive subroutine elapsed times show that func_c() took between 0.5
71 seconds and 1 second, func_b() took between 1 second and 2.1 seconds, and
72 func_a() took between 2.1 seconds and 4.2 seconds to execute. This time
73 includes the time spent in other subroutines called, and since func_a() called
74 func_b() which called func_c(), these times make sense.
76 These elapsed times are the absolute time from when the subroutine began to
77 when it completed - which includes off-CPU time due to other system events
78 such as I/O, scheduling, interrupts, etc.
80 Elapsed times are useful for identifying where latencies are.
81 See Notes/ALLelapsed_notes.txt for more details. Also see
82 Notes/ALLexclusive_notes.txt and Notes/ALLinclusive_notes.txt for a
83 detailed explanation of exclusive vs inclusive subroutine time.