@@ -5,7 +5,8 @@ Graph Types
5
5
6
6
The PStats server offers a range of different graphs, giving different views of
7
7
the data being sent from the client. The graph windows can be opened from the
8
- Graphs pull-down menu.
8
+ Graphs pull-down menu, but they can also be opened by right-clicking a
9
+ particular collector in a chart.
9
10
10
11
.. contents ::
11
12
:local:
@@ -25,58 +26,43 @@ represents the total amount of time spent on each frame; within the frame, the
25
26
time is further divided into the primary subdivisions represented by different
26
27
color bands (and labeled on the left). These subdivisions are called
27
28
"collectors" in the PStats terminology, since they represent time collected by
28
- different tasks.
29
-
30
- Normally, the three primary collectors are App, Cull, and Draw, the three stages
31
- of the graphics pipeline. Atop these three colored collectors is the label
32
- "Frame", which represents any remaining time spent in the frame that was not
33
- specifically allocated to one of the three child collectors (normally, there
34
- should not be significant time reported here).
35
-
36
- The frame time in milliseconds, averaged over the past three seconds, is drawn
37
- above the upper right corner of the graph. The labels on the guide bars on the
38
- right are also shown in milliseconds; if you prefer to think about a target
39
- frame rate rather than an elapsed time in milliseconds, you may find it useful
40
- to select "Hz" from the Units pulldown menu, which changes the time units
41
- accordingly.
42
-
43
- The running Panda client suggests its target frame rate, as well as the initial
44
- vertical scale of the graph (that is, the height of the colored bars). You can
45
- change the scale freely by clicking within the graph itself and dragging the
46
- mouse up or down as necessary. One of the horizontal guide bars is drawn in a
47
- lighter shade of gray; this one represents the actual target frame rate
48
- suggested by the client. The other, darker, guide bars are drawn automatically
49
- at harmonic subdivisions of the target frame rate. You can change the target
50
- frame rate with the Config.prc variable pstats-target-frame-rate on the client.
51
-
52
- You can also create any number of user-defined guide bars by dragging them into
53
- the graph from the gray space immediately above or below the graph. These are
54
- drawn in a dashed blue line. It is sometimes useful to place one of these to
55
- mark a performance level so it may be compared to future values (or to alternate
56
- configurations).
57
-
58
- The primary collectors labeled on the left might themselves be further
59
- subdivided, if the data is provided by the client. For instance, App is often
60
- divided into Show Code, Animation, and Collisions, where Show Code is the time
29
+ different tasks. The top-most label indicates the collector that is currently
30
+ being viewed, and the labels below it indicate its subdivisions.
31
+
32
+ Normally, the primary collector is called "Frame", representing the total amount
33
+ of time spent rendering a particular frame. This is subdivided into App, Cull,
34
+ and Draw, the three stages of the graphics pipeline, a Wait collector for time
35
+ spent waiting on other threads or VSync, and a further \* collector for
36
+ operations that may occur across multiple stages. Any remaining time not
37
+ specifically allocated to one of those child collectors is assigned to the
38
+ parent "Frame" collector (normally, there should not be significant time
39
+ reported here).
40
+
41
+ All of these categories contain further subdivisions, which themselves may be
42
+ subdivided further, if this data is provided by the client. For instance, App is
43
+ often divided into Tasks, Animation, and Collisions, where Tasks is the time
61
44
spent executing any Python code, Animation is the time used to compute any
62
45
animated characters, and Collisions is the time spent in the collision
63
- traverser(s).
46
+ traverser(s), etc .
64
47
65
48
To see any of these further breakdowns, double-click on the corresponding
66
49
colored label (or on the colored band within the graph itself). This narrows the
67
- focus of the strip chart from the overall frame to just the selected collector,
68
- which has two advantages. Firstly, it may be easier to observe the behavior of
69
- one particular collector when it is drawn alone (as opposed to being stacked on
70
- top of some other color bars), and the time in the upper-right corner will now
71
- reflect just the total time spent within just this collector. Secondly, if there
72
- are further breakdowns to this collector, they will now be shown as further
73
- colored bars. As in the Frame chart, the topmost label is the name of the parent
74
- collector, and any time shown in this color represents time allocated to the
75
- parent collector that is not accounted for by any of the child collectors.
76
-
77
- You can further drill down by double-clicking on any of the new labels; or
78
- double-click on the top label, or the white part of the graph, to return back up
79
- to the previous level. Right-clicking a label will provide further options.
50
+ focus of the strip chart from the overall frame to just the selected collector.
51
+ Not only does it make it easier to observe the behavior of that particular
52
+ collector since it is drawn alone (as opposed to being stacked on top of some
53
+ other color bars), but if there are further breakdowns to this collector, they
54
+ will now be shown as further colored bars. As in the Frame chart, the topmost
55
+ label is the name of the currently focused collector, and any time shown in this
56
+ color represents time allocated to the current collector that is not accounted
57
+ for by any of the child collectors. To return to the parent level, simply
58
+ double-click this top-most collector.
59
+
60
+ The time spent in the currently focused collector, averaged over the past three
61
+ seconds, is drawn above the upper right corner of the graph. By default, this is
62
+ shown in milliseconds, which is a better metric than a target frame rate, but
63
+ the unit can be changed from the Units pulldown menu if desirable. Some
64
+ collectors will additionally show a number indicating how often they were
65
+ started in the latest frame.
80
66
81
67
Value-based Strip Charts
82
68
------------------------
@@ -106,7 +92,7 @@ The way the bars are stacked indicates how the collectors are nested. Let's say
106
92
that Panda3D performs a Cull pass for display region A and B separately. The
107
93
Strip Chart view would just tell you the total Cull time in the frame, which
108
94
doesn't tell you which scene you need to optimize. The Flame Graph view on the
109
- other hand, will show two separate Cull bars, one stacked above the bar for
95
+ other hand will show two separate Cull bars, one stacked above the bar for
110
96
display region A, and the other stacked above the bar for display region B.
111
97
112
98
You can double-click on any bar to focus in to that particular collector and
@@ -139,11 +125,16 @@ clock, the GPU and CPU threads may not be perfectly aligned.
139
125
There are several ways to navigate through the timeline. By double-clicking a
140
126
particular bar, the view will zoom to fit that bar. You can also use the WASD
141
127
keys to navigate, or the scroll wheel of the mouse while holding the control key
142
- on the keyboard.
128
+ on the keyboard. If the timeline takes up so much vertical space that it runs
129
+ off the edge of the chart, you can use the scroll wheel of the mouse *without *
130
+ holding the control key to bring everything into view.
143
131
144
132
Please note that PStats discards data older than 60 seconds by default. To be
145
133
able to see the entire timeline, you need to change the ``pstats-history ``
146
- configuration variable.
134
+ configuration variable (eg. you could set it to ``inf `` to never discard data).
135
+ Furthermore, it is possible to see dropped frames if the frame rate is too high
136
+ or if the send queue is full. If you wish to see all frames, increase the
137
+ ``pstats-max-rate `` and ``pstats-max-queue-size `` variables.
147
138
148
139
The Piano Roll
149
140
--------------
@@ -164,7 +155,9 @@ reads from left to right.)
164
155
Unlike a strip chart, a piano roll chart does not show trends; the chart shows
165
156
only the current frame's data. The horizontal axis shows time within the frame,
166
157
and the individual collectors are stacked up in an arbitrary ordering along the
167
- vertical axis.
158
+ vertical axis. It is possible that there are so many collectors that they run
159
+ off the edge of the window; in this case, use the scroll wheel on a mouse to
160
+ scroll through the label stack on the left side.
168
161
169
162
The time spent within the frame is drawn from left to right; at any given time,
170
163
the collector(s) that are active will be drawn with a horizontal bar. You can
0 commit comments