15 #include "config_pstats.h"
19 ConfigureDef(config_pstats);
20 NotifyCategoryDef(pstats,
"");
22 ConfigureFn(config_pstats) {
23 init_libpstatclient();
27 (
"pstats-name",
"Panda Stats");
30 (
"pstats-max-rate", 1000.0,
31 PRC_DESC(
"The maximum number of packets per second, per thread, to send "
32 "to the remote PStats server. A packet is defined as a single "
33 "UDP packet, or each 1024 bytes of a TCP message."));
36 (
"pstats-threaded-write",
true,
37 PRC_DESC(
"Set this true to write to the PStats channel in a sub-thread, if "
38 "threading is available. Can't think of any reason why you "
39 "wouldn't want this set true, unless you suspect something is "
40 "broken with the threaded network interfaces."));
43 (
"pstats-max-queue-size", 1,
44 PRC_DESC(
"If pstats-threaded-write is true, this specifies the maximum "
45 "number of packets (generally, frames of data) that may be queued "
46 "up for the thread to process. If this is large, the writer "
47 "thread may fall behind and the output of PStats will lag. Keep "
48 "this small to drop missed packets on the floor instead, and "
49 "ensure that the frame data does not grow stale."));
52 (
"pstats-tcp-ratio", 0.01,
53 PRC_DESC(
"This specifies the ratio of frame update messages that are eligible "
54 "for UDP that are sent via TCP instead. It does not count messages "
55 "that are too large for UDP and must be sent via TCP anyway. 1.0 "
56 "means all messages are sent TCP; 0.0 means all are sent UDP."));
59 (
"pstats-host",
"localhost");
63 (
"pstats-port", 5185);
66 (
"pstats-target-frame-rate", 30.0,
67 PRC_DESC(
"Specify the target frame rate to highlight on the PStats graph. "
68 "This frame rate is marked with a different-colored line; "
69 "otherwise, this setting has no effect."));
72 (
"pstats-gpu-timing",
false,
73 PRC_DESC(
"Set this true to query the graphics library for the actual time "
74 "that graphics operations take to execute on the video card. "
75 "Enabling this will harm performance, but this information can "
76 "be more useful than the regular Draw information in tracking "
77 "down bottlenecks, because the CPU-based Draw collectors only "
78 "measure how long it takes for the API call to complete, which "
79 "is not usually an accurate reflectino of how long the actual "
80 "operation takes on the video card."));
85 (
"pstats-scroll-mode",
true);
87 (
"pstats-history", 60.0);
89 (
"pstats-average-time", 3.0);
92 (
"pstats-mem-other",
true,
93 PRC_DESC(
"Set this true to collect memory categories smaller than 0.1% of "
94 "the total into a single \"Other\" category, or false to show "
95 "each nonzero memory category."));
106 init_libpstatclient() {
107 static bool initialized =
false;
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This is a convenience class to specialize ConfigVariable as a string type.
This is a convenience class to specialize ConfigVariable as an integer type.