28static const int current_pstat_major_version = 3;
29static const int current_pstat_minor_version = 0;
46 return current_pstat_major_version;
59 return current_pstat_minor_version;
82struct TimeCollectorProperties {
86 double suggested_scale;
89struct LevelCollectorProperties {
94 double suggested_scale;
98static TimeCollectorProperties time_properties[] = {
99 { 1,
"Frame", { 0.95, 1.0, 0.35 } },
100 { 1,
"Wait", { 0.6, 0.6, 0.6 } },
101 { 0,
"Wait:Mutex block", { 0.5, 0.0, 1.0 } },
102 { 1,
"Wait:Thread sync", { 0.0, 1.0, 0.5 } },
103 { 1,
"Wait:Clock Wait", { 0.2, 0.8, 0.2 } },
104 { 1,
"Wait:Clock Wait:Sleep", { 0.9, 0.4, 0.8 } },
105 { 1,
"Wait:Clock Wait:Spin", { 0.2, 0.8, 1.0 } },
106 { 1,
"Wait:Flip", { 1.0, 0.6, 0.3 } },
107 { 1,
"Wait:Flip:Begin", { 0.3, 0.3, 0.9 } },
108 { 1,
"Wait:Flip:End", { 0.9, 0.3, 0.6 } },
109 { 1,
"App", { 0.0, 0.4, 0.8 }, 1.0 / 30.0 },
110 { 1,
"App:Collisions", { 1.0, 0.5, 0.0 } },
111 { 1,
"App:Collisions:Reset", { 0.0, 0.0, 0.5 } },
112 { 0,
"App:Data graph", { 0.5, 0.8, 0.4 } },
113 { 1,
"App:Show code", { 0.8, 0.2, 1.0 } },
114 { 0,
"App:Show code:Nametags", { 0.8, 0.8, 1.0 } },
115 { 0,
"App:Show code:Nametags:2d", { 0.0, 0.0, 0.5 } },
116 { 0,
"App:Show code:Nametags:2d:Contents", { 0.0, 0.5, 0.0 } },
117 { 0,
"App:Show code:Nametags:2d:Adjust", { 0.5, 0.0, 0.5 } },
118 { 0,
"App:Show code:Nametags:3d", { 1.0, 0.0, 0.0 } },
119 { 0,
"App:Show code:Nametags:3d:Contents", { 0.0, 0.5, 0.0 } },
120 { 0,
"App:Show code:Nametags:3d:Adjust", { 0.5, 0.0, 0.5 } },
121 { 1,
"Cull", { 0.21, 0.68, 0.37 }, 1.0 / 30.0 },
122 { 1,
"Cull:Setup", { 0.7, 0.4, 0.5 } },
123 { 1,
"Cull:Sort", { 0.3, 0.3, 0.6 } },
124 { 1,
"*", { 0.1, 0.1, 0.5 } },
125 { 1,
"*:Show fps", { 0.5, 0.8, 1.0 } },
126 { 1,
"*:Munge", { 0.3, 0.3, 0.9 } },
127 { 1,
"*:Munge:Geom", { 0.4, 0.2, 0.8 } },
128 { 1,
"*:Munge:Sprites", { 0.2, 0.8, 0.4 } },
129 { 0,
"*:Munge:Data", { 0.7, 0.5, 0.2 } },
130 { 0,
"*:Munge:Rotate", { 0.9, 0.8, 0.5 } },
131 { 0,
"*:Munge:Decompose", { 0.1, 0.3, 0.1 } },
132 { 1,
"*:PStats", { 0.4, 0.8, 1.0 } },
133 { 1,
"*:Animation", { 1.0, 0.0, 1.0 } },
134 { 0,
"*:Flatten", { 0.0, 0.7, 0.4 } },
135 { 0,
"*:State Cache", { 0.4, 0.7, 0.7 } },
136 { 0,
"*:NodePath", { 0.1, 0.6, 0.8 } },
137 { 1,
"Draw", { 0.83, 0.02, 0.01 }, 1.0 / 30.0 },
138 { 1,
"Draw:Make current", { 0.4, 0.2, 0.6 } },
139 { 1,
"Draw:Copy texture", { 0.2, 0.6, 0.4 } },
140 { 1,
"Draw:Transfer data", { 0.8, 0.0, 0.6 } },
141 { 1,
"Draw:Transfer data:Vertex buffer", { 0.0, 0.1, 0.9 } },
142 { 1,
"Draw:Transfer data:Index buffer", { 0.1, 0.9, 0.0 } },
143 { 1,
"Draw:Transfer data:Texture", { 0.9, 0.0, 0.1 } },
144 { 1,
"Draw:Transfer data:Display lists", { 0.5, 0.0, 0.9 } },
145 { 1,
"Draw:Clear", { 0.0, 0.8, 0.6 } },
146 { 1,
"Draw:Flush", { 0.9, 0.2, 0.7 } },
147 { 1,
"Draw:Sync", { 0.5, 0.7, 0.7 } },
148 { 0,
"Draw:Transform", { 0.0, 0.5, 0.0 } },
149 { 1,
"Draw:Primitive", { 0.0, 0.0, 0.5 } },
150 { 1,
"Draw:Set State", { 0.2, 0.6, 0.8 } },
151 { 1,
"Draw:Wait occlusion", { 1.0, 0.5, 0.0 } },
152 { 1,
"Draw:Bind FBO", { 0.0, 0.8, 0.8 } },
156static LevelCollectorProperties level_properties[] = {
157 { 1,
"Graphics memory", { 0.0, 0.0, 1.0 },
"MB", 64, 1048576 },
158 { 1,
"Buffer switch", { 0.0, 0.6, 0.8 },
"", 500 },
159 { 1,
"Buffer switch:Vertex", { 0.8, 0.0, 0.6 } },
160 { 1,
"Buffer switch:Index", { 0.8, 0.6, 0.3 } },
161 { 1,
"Geom cache size", { 0.6, 0.8, 0.6 },
"", 500 },
162 { 1,
"Geom cache size:Active", { 0.9, 1.0, 0.3 },
"", 500 },
163 { 1,
"Geom cache operations", { 1.0, 0.6, 0.6 },
"", 500 },
164 { 1,
"Geom cache operations:record", { 0.2, 0.4, 0.8 } },
165 { 1,
"Geom cache operations:erase", { 0.4, 0.8, 0.2 } },
166 { 1,
"Geom cache operations:evict", { 0.8, 0.2, 0.4 } },
167 { 1,
"Data transferred", { 0.0, 0.2, 0.4 },
"MB", 12, 1048576 },
168 { 1,
"Primitive batches", { 0.2, 0.5, 0.9 },
"", 500 },
169 { 1,
"Primitive batches:Other", { 0.2, 0.2, 0.2 } },
170 { 1,
"Primitive batches:Triangles", { 0.8, 0.8, 0.8 } },
171 { 1,
"Primitive batches:Triangle fans", { 0.8, 0.5, 0.2 } },
172 { 1,
"Primitive batches:Triangle strips",{ 0.2, 0.5, 0.8 } },
173 { 1,
"Primitive batches:Display lists", { 0.8, 0.5, 1.0 } },
174 { 1,
"SW Sprites", { 0.2, 0.7, 0.3 },
"K", 10, 1000 },
175 { 1,
"Vertices", { 0.5, 0.2, 0.0 },
"K", 10, 1000 },
176 { 1,
"Vertices:Other", { 0.2, 0.2, 0.2 } },
177 { 1,
"Vertices:Triangles", { 0.8, 0.8, 0.8 } },
178 { 1,
"Vertices:Triangle fans", { 0.8, 0.5, 0.2 } },
179 { 1,
"Vertices:Triangle strips", { 0.2, 0.5, 0.8 } },
180 { 1,
"Vertices:Indexed triangle strips", { 0.5, 0.2, 0.8 } },
181 { 1,
"Vertices:Display lists", { 0.8, 0.5, 1.0 } },
182 { 1,
"Vertices:Immediate mode", { 1.0, 0.5, 0.0 } },
183 { 1,
"Pixels", { 0.8, 0.3, 0.7 },
"M", 5, 1000000 },
184 { 1,
"Nodes", { 0.4, 0.2, 0.8 },
"", 500.0 },
185 { 1,
"Nodes:GeomNodes", { 0.8, 0.2, 0.0 } },
186 { 1,
"Geoms", { 0.4, 0.8, 0.3 },
"", 500.0 },
187 { 1,
"Cull volumes", { 0.7, 0.6, 0.9 },
"", 500.0 },
188 { 1,
"Cull volumes:Transforms", { 0.9, 0.6, 0.0 } },
189 { 1,
"State changes", { 1.0, 0.5, 0.2 },
"", 500.0 },
190 { 1,
"State changes:Other", { 0.2, 0.2, 0.2 } },
191 { 1,
"State changes:Transforms", { 0.2, 0.2, 0.8 } },
192 { 1,
"State changes:Textures", { 0.8, 0.2, 0.2 } },
193 { 1,
"Occlusion tests", { 0.9, 0.8, 0.3 },
"", 500.0 },
194 { 1,
"Occlusion results", { 0.3, 0.9, 0.8 },
"", 500.0 },
195 { 1,
"System memory", { 0.5, 1.0, 0.5 },
"MB", 64, 1048576 },
196 { 1,
"System memory:Heap", { 0.2, 0.2, 1.0 } },
197 { 1,
"System memory:Heap:Overhead", { 0.3, 0.4, 0.6 } },
198 { 1,
"System memory:Heap:Single", { 0.8, 0.3, 0.3 } },
199 { 1,
"System memory:Heap:Array", { 0.1, 0.3, 1.0 } },
200 { 1,
"System memory:Heap:Overhead", { 0.9, 0.7, 0.8 } },
201 { 1,
"System memory:Heap:External", { 0.2, 0.2, 0.5 } },
202 { 1,
"System memory:MMap", { 0.9, 0.4, 0.7 } },
203 { 1,
"Vertex Data", { 1.0, 0.4, 0.0 },
"MB", 64, 1048576 },
204 { 1,
"Vertex Data:Independent", { 0.9, 0.1, 0.9 } },
205 { 1,
"Vertex Data:Small", { 0.2, 0.3, 0.4 } },
206 { 1,
"Vertex Data:Pending", { 0.6, 0.8, 1.0 } },
207 { 1,
"Vertex Data:Resident", { 0.9, 1.0, 0.7 } },
208 { 1,
"Vertex Data:Compressed", { 0.5, 0.1, 0.4 } },
209 { 1,
"Vertex Data:Disk", { 0.6, 0.9, 0.1 } },
210 { 1,
"Vertex Data:Disk:Unused", { 0.8, 0.4, 0.5 } },
211 { 1,
"Vertex Data:Disk:Used", { 0.2, 0.1, 0.6 } },
212 { 1,
"TransformStates", { 1.0, 0.5, 0.5 },
"", 5000 },
213 { 1,
"TransformStates:On nodes", { 0.2, 0.8, 1.0 } },
214 { 1,
"TransformStates:Cached", { 1.0, 0.0, 0.2 } },
215 { 1,
"TransformStates:Unused", { 0.2, 0.2, 0.2 } },
216 { 1,
"RenderStates", { 0.5, 0.5, 1.0 },
"", 1000 },
217 { 1,
"RenderStates:On nodes", { 0.2, 0.8, 1.0 } },
218 { 1,
"RenderStates:Cached", { 1.0, 0.0, 0.2 } },
219 { 1,
"RenderStates:Unused", { 0.2, 0.2, 0.2 } },
220 { 1,
"PipelineCyclers", { 0.5, 0.5, 1.0 },
"", 50000 },
221 { 1,
"Dirty PipelineCyclers", { 0.2, 0.2, 0.2 },
"", 5000 },
222 { 1,
"Collision Volumes", { 1.0, 0.8, 0.5 },
"", 500 },
223 { 1,
"Collision Tests", { 0.5, 0.8, 1.0 },
"", 100 },
224 { 1,
"Command latency", { 0.8, 0.2, 0.0 },
"ms", 10, 1.0 / 1000.0 },
234initialize_collector_def_from_table(
const string &fullname,
PStatCollectorDef *def) {
238 time_properties[i].name !=
nullptr;
240 const TimeCollectorProperties &tp = time_properties[i];
241 if (fullname == tp.name) {
243 if (!def->_active_explicitly_set) {
244 def->_is_active = tp.is_active;
246 def->_suggested_color = tp.color;
247 if (tp.suggested_scale != 0.0) {
248 def->_suggested_scale = tp.suggested_scale;
255 level_properties[i].name !=
nullptr;
257 const LevelCollectorProperties &lp = level_properties[i];
258 if (fullname == lp.name) {
260 if (!def->_active_explicitly_set) {
261 def->_is_active = lp.is_active;
263 def->_suggested_color = lp.color;
264 if (lp.suggested_scale != 0.0) {
265 def->_suggested_scale = lp.suggested_scale;
267 if (lp.units !=
nullptr) {
268 def->_level_units = lp.units;
270 if (lp.inv_factor != 0.0) {
271 def->_factor = 1.0 / lp.inv_factor;
289 if (def->_index == 0) {
290 fullname = def->_name;
292 fullname = client->get_collector_fullname(def->_index);
296 initialize_collector_def_from_table(fullname, def);
304 string::const_iterator ni;
305 for (ni = fullname.begin(); ni != fullname.end(); ++ni) {
317 config_name += tolower(*ni);
323 (
"pstats-active-" + config_name,
true,
"", ConfigVariable::F_dynamic);
325 (
"pstats-sort-" + config_name, def->_sort,
"", ConfigVariable::F_dynamic);
327 (
"pstats-scale-" + config_name, def->_suggested_scale,
"", ConfigVariable::F_dynamic);
329 (
"pstats-units-" + config_name, def->_level_units,
"", ConfigVariable::F_dynamic);
331 (
"pstats-factor-" + config_name, 1.0,
"", ConfigVariable::F_dynamic);
333 (
"pstats-color-" + config_name, LColor::zero(),
"", ConfigVariable::F_dynamic);
335 if (pstats_active.has_value()) {
336 def->_is_active = pstats_active;
337 def->_active_explicitly_set =
true;
340 def->_sort = pstats_sort;
341 def->_suggested_scale = pstats_scale;
342 def->_level_units = pstats_units;
343 if (pstats_factor.has_value()) {
344 def->_factor = pstats_factor;
347 if (pstats_color.has_value()) {
348 def->_suggested_color.r = pstats_color[0];
349 def->_suggested_color.g = pstats_color[1];
350 def->_suggested_color.b = pstats_color[2];
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a set of floating-point types representin...
This is a convenience class to specialize ConfigVariable as a floating- point type.
This is a convenience class to specialize ConfigVariable as an integer type.
This is a convenience class to specialize ConfigVariable as a string type.
Manages the communications to report statistics via a network connection to a remote PStatServer.
Defines the details about the Collectors: the name, the suggested color, etc.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_current_pstat_major_version()
Returns the current major version number of the PStats protocol.
int get_current_pstat_minor_version()
Returns the current minor version number of the PStats protocol.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.