Panda3D
Loading...
Searching...
No Matches
config_pstatclient.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file config_pstatclient.cxx
10 * @author drose
11 * @date 2000-07-09
12 */
13
14#include "config_pstatclient.h"
15
16#include "dconfig.h"
17
18#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_PSTATCLIENT)
19 #error Buildsystem error: BUILDING_PANDA_PSTATCLIENT not defined
20#endif
21
22ConfigureDef(config_pstatclient);
23NotifyCategoryDef(pstats, "");
24
25ConfigureFn(config_pstatclient) {
27}
28
29ConfigVariableString pstats_name
30("pstats-name", "Panda Stats");
31
32ConfigVariableDouble pstats_max_rate
33("pstats-max-rate", 1000.0,
34 PRC_DESC("The maximum number of packets per second, per thread, to send "
35 "to the remote PStats server. A packet is defined as a single "
36 "UDP packet, or each 1024 bytes of a TCP message. Set this to a "
37 "negative number to disable the limit."));
38
39ConfigVariableBool pstats_threaded_write
40("pstats-threaded-write", true,
41 PRC_DESC("Set this true to write to the PStats channel in a sub-thread, if "
42 "threading is available. Can't think of any reason why you "
43 "wouldn't want this set true, unless you suspect something is "
44 "broken with the threaded network interfaces."));
45
46ConfigVariableInt pstats_max_queue_size
47("pstats-max-queue-size", 4,
48 PRC_DESC("If pstats-threaded-write is true, this specifies the maximum "
49 "number of packets (generally, frames of data) that may be queued "
50 "up for the thread to process. If this is large, the writer "
51 "thread may fall behind and the output of PStats will lag. Keep "
52 "this small to drop missed packets on the floor instead, and "
53 "ensure that the frame data does not grow stale."));
54
55ConfigVariableDouble pstats_tcp_ratio
56("pstats-tcp-ratio", 0.01,
57 PRC_DESC("This specifies the ratio of frame update messages that are eligible "
58 "for UDP that are sent via TCP instead. It does not count messages "
59 "that are too large for UDP and must be sent via TCP anyway. 1.0 "
60 "means all messages are sent TCP; 0.0 means all are sent UDP."));
61
62ConfigVariableString pstats_host
63("pstats-host", "localhost");
64
65// The default port for PStats used to be 5180, but that's used by AIM.
66ConfigVariableInt pstats_port
67("pstats-port", 5185);
68
69ConfigVariableDouble pstats_target_frame_rate
70("pstats-target-frame-rate", 30.0,
71 PRC_DESC("Specify the target frame rate to highlight on the PStats graph. "
72 "This frame rate is marked with a different-colored line; "
73 "otherwise, this setting has no effect."));
74
75ConfigVariableBool pstats_gpu_timing
76("pstats-gpu-timing", false,
77 PRC_DESC("Set this true to query the graphics library for the actual time "
78 "that graphics operations take to execute on the video card. "
79 "Enabling this will harm performance, but this information can "
80 "be more useful than the regular Draw information in tracking "
81 "down bottlenecks, because the CPU-based Draw collectors only "
82 "measure how long it takes for the API call to complete, which "
83 "is not usually an accurate reflectino of how long the actual "
84 "operation takes on the video card."));
85
86ConfigVariableBool pstats_python_profiler
87("pstats-python-profiler", false,
88 PRC_DESC("Set this true to integrate with the Python profiler to show "
89 "detailed information about individual Python functions in "
90 "PStats, similar to the information offered by Python's built-in "
91 "profiler. This can be really useful to find bottlenecks in a "
92 "Python program, but enabling this will slow down the application "
93 "somewhat, and requires a recent version of the PStats server, so "
94 "it is not enabled by default."));
95
96// The rest are different in that they directly control the server, not the
97// client.
98ConfigVariableBool pstats_scroll_mode
99("pstats-scroll-mode", true);
100ConfigVariableDouble pstats_history
101("pstats-history", 60.0);
102ConfigVariableDouble pstats_average_time
103("pstats-average-time", 3.0);
104
105ConfigVariableBool pstats_mem_other
106("pstats-mem-other", true,
107 PRC_DESC("Set this true to collect memory categories smaller than 0.1% of "
108 "the total into a single \"Other\" category, or false to show "
109 "each nonzero memory category."));
110
111/**
112 * Initializes the library. This must be called at least once before any of
113 * the functions or classes in this library can be used. Normally it will be
114 * called by the static initializers and need not be called explicitly, but
115 * special cases exist.
116 */
117void
119 static bool initialized = false;
120 if (initialized) {
121 return;
122 }
123 initialized = true;
124}
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 an integer type.
This is a convenience class to specialize ConfigVariable as a string type.
void init_libpstatclient()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.