Panda3D
panda
src
pstatclient
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
22
ConfigureDef(config_pstatclient);
23
NotifyCategoryDef(pstats,
""
);
24
25
ConfigureFn(config_pstatclient) {
26
init_libpstatclient
();
27
}
28
29
ConfigVariableString
pstats_name
30
(
"pstats-name"
,
"Panda Stats"
);
31
32
ConfigVariableDouble
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."
));
37
38
ConfigVariableBool
pstats_threaded_write
39
(
"pstats-threaded-write"
,
true
,
40
PRC_DESC(
"Set this true to write to the PStats channel in a sub-thread, if "
41
"threading is available. Can't think of any reason why you "
42
"wouldn't want this set true, unless you suspect something is "
43
"broken with the threaded network interfaces."
));
44
45
ConfigVariableInt
pstats_max_queue_size
46
(
"pstats-max-queue-size"
, 1,
47
PRC_DESC(
"If pstats-threaded-write is true, this specifies the maximum "
48
"number of packets (generally, frames of data) that may be queued "
49
"up for the thread to process. If this is large, the writer "
50
"thread may fall behind and the output of PStats will lag. Keep "
51
"this small to drop missed packets on the floor instead, and "
52
"ensure that the frame data does not grow stale."
));
53
54
ConfigVariableDouble
pstats_tcp_ratio
55
(
"pstats-tcp-ratio"
, 0.01,
56
PRC_DESC(
"This specifies the ratio of frame update messages that are eligible "
57
"for UDP that are sent via TCP instead. It does not count messages "
58
"that are too large for UDP and must be sent via TCP anyway. 1.0 "
59
"means all messages are sent TCP; 0.0 means all are sent UDP."
));
60
61
ConfigVariableString
pstats_host
62
(
"pstats-host"
,
"localhost"
);
63
64
// The default port for PStats used to be 5180, but that's used by AIM.
65
ConfigVariableInt
pstats_port
66
(
"pstats-port"
, 5185);
67
68
ConfigVariableDouble
pstats_target_frame_rate
69
(
"pstats-target-frame-rate"
, 30.0,
70
PRC_DESC(
"Specify the target frame rate to highlight on the PStats graph. "
71
"This frame rate is marked with a different-colored line; "
72
"otherwise, this setting has no effect."
));
73
74
ConfigVariableBool
pstats_gpu_timing
75
(
"pstats-gpu-timing"
,
false
,
76
PRC_DESC(
"Set this true to query the graphics library for the actual time "
77
"that graphics operations take to execute on the video card. "
78
"Enabling this will harm performance, but this information can "
79
"be more useful than the regular Draw information in tracking "
80
"down bottlenecks, because the CPU-based Draw collectors only "
81
"measure how long it takes for the API call to complete, which "
82
"is not usually an accurate reflectino of how long the actual "
83
"operation takes on the video card."
));
84
85
// The rest are different in that they directly control the server, not the
86
// client.
87
ConfigVariableBool
pstats_scroll_mode
88
(
"pstats-scroll-mode"
,
true
);
89
ConfigVariableDouble
pstats_history
90
(
"pstats-history"
, 60.0);
91
ConfigVariableDouble
pstats_average_time
92
(
"pstats-average-time"
, 3.0);
93
94
ConfigVariableBool
pstats_mem_other
95
(
"pstats-mem-other"
,
true
,
96
PRC_DESC(
"Set this true to collect memory categories smaller than 0.1% of "
97
"the total into a single \"Other\" category, or false to show "
98
"each nonzero memory category."
));
99
100
/**
101
* Initializes the library. This must be called at least once before any of
102
* the functions or classes in this library can be used. Normally it will be
103
* called by the static initializers and need not be called explicitly, but
104
* special cases exist.
105
*/
106
void
107
init_libpstatclient
() {
108
static
bool
initialized =
false
;
109
if
(initialized) {
110
return
;
111
}
112
initialized =
true
;
113
}
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition:
configVariableBool.h:23
init_libpstatclient
void init_libpstatclient()
Initializes the library.
Definition:
config_pstatclient.cxx:107
config_pstatclient.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dconfig.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ConfigVariableDouble
This is a convenience class to specialize ConfigVariable as a floating- point type.
Definition:
configVariableDouble.h:24
ConfigVariableInt
This is a convenience class to specialize ConfigVariable as an integer type.
Definition:
configVariableInt.h:24
ConfigVariableString
This is a convenience class to specialize ConfigVariable as a string type.
Definition:
configVariableString.h:23
Generated on Sat Jan 11 2020 15:15:31 for Panda3D by
1.8.17