move a few more PStatCollectors out of local statics

This commit is contained in:
David Rose
2011-11-19 00:11:43 +00:00
parent 1ead653ce5
commit 39b32376bb
4 changed files with 9 additions and 4 deletions

View File

@@ -80,6 +80,8 @@
int NodePath::_max_search_depth = 7000;
TypeHandle NodePath::_type_handle;
PStatCollector NodePath::_get_transform_pcollector("*:NodePath:get_transform");
PStatCollector NodePath::_verify_complete_pcollector("*:NodePath:verify_complete");
#ifdef HAVE_PYTHON
#include "py_panda.h"
@@ -1097,7 +1099,6 @@ get_transform(Thread *current_thread) const {
CPT(TransformState) NodePath::
get_transform(const NodePath &other, Thread *current_thread) const {
nassertr(_error_type == ET_ok && other._error_type == ET_ok, TransformState::make_identity());
static PStatCollector _get_transform_pcollector("*:NodePath:get_transform");
PStatTimer timer(_get_transform_pcollector);
if (other.is_empty()) {
@@ -6509,7 +6510,6 @@ verify_complete(Thread *current_thread) const {
}
#endif // HAVE_THREADS
static PStatCollector _verify_complete_pcollector("*:NodePath:verify_complete");
PStatTimer timer(_verify_complete_pcollector);
const NodePathComponent *comp = _head;

View File

@@ -989,6 +989,9 @@ private:
ErrorType _error_type;
static int _max_search_depth;
static PStatCollector _get_transform_pcollector;
static PStatCollector _verify_complete_pcollector;
public:
static TypeHandle get_class_type() {
return _type_handle;

View File

@@ -52,7 +52,7 @@
TypeHandle TextNode::_type_handle;
static PStatCollector text_generate_collector("*:Generate Text");
PStatCollector TextNode::_text_generate_pcollector("*:Generate Text");
////////////////////////////////////////////////////////////////////
// Function: TextNode::Constructor
@@ -343,7 +343,7 @@ write(ostream &out, int indent_level) const {
////////////////////////////////////////////////////////////////////
PT(PandaNode) TextNode::
generate() {
PStatTimer timer(text_generate_collector);
PStatTimer timer(_text_generate_pcollector);
if (text_cat.is_debug()) {
text_cat.debug()
<< "Rebuilding " << get_type() << " " << get_name()

View File

@@ -322,6 +322,8 @@ private:
int _num_rows;
wstring _wordwrapped_wtext;
static PStatCollector _text_generate_pcollector;
public:
static TypeHandle get_class_type() {
return _type_handle;