12 #ifndef COP2_DebugTiming_H
13 #define COP2_DebugTiming_H
32 : myNodePath(nodepath, 1),
48 myMinCookTime =
SYSmin(time, myMinCookTime);
49 myMaxCookTime =
SYSmax(time, myMaxCookTime);
51 myTotalCookTime +=
time;
55 void print(std::ostream &os)
const
58 os << myNodePath <<
"\n " << myNumCooks <<
" "
59 << myTotalCookTime <<
"s min " << myMinCookTime <<
"s max "
60 << myMaxCookTime <<
"s avg "
61 << (myTotalCookTime / myNumCooks) <<
"s";
63 os << myNodePath <<
" not cooked.";
115 if(!myTable.findSymbol(path, &tnode))
118 myTable.addSymbol(path, tnode);
123 myTableLock.unlock();
133 os <<
"Total time: " << pdata.
total_time <<
"s\n";
172 it != myWatches.
end(); ++it)
179 cerr << indent <<
"Thread " << it.thread() <<
":\n";
183 cerr << indent <<
" " << itW.name() <<
" : " << itW.thing().getTime() <<
"s\n";
185 sum[itW.name()] = itW.thing().getTime();
187 sum[itW.name()] += itW.thing().getTime();
191 cerr << indent <<
"Thread Total:\n";
192 for (
auto itW = sum.
begin(); !itW.atEnd(); ++itW)
194 cerr << indent <<
" " << itW.name() <<
" : " << itW.thing() <<
"s\n";
200 for (ThreadWatches::iterator it = myWatches.
begin();
201 it != myWatches.
end(); ++it)
203 it.get().myWatches.clear();
208 ThreadWatches myWatches;
215 myWatches(w), myName(name)
const_iterator begin() const
begin() const iterator
void start(const char *name)
UT_SymbolMap< UT_StopWatch > myWatches
void stop(const char *name)
GT_API const UT_StringHolder time
const_iterator end() const
end() const iterator
GLsizei const GLchar *const * path
void addCop2Timing(OP_Node *cop2node, double time)
void print(std::ostream &os) const
const char * getFullPath(UT_String &str) const
void printTimes(const char *indent="")
void addCookTime(double time)
GLuint const GLchar * name
friend class const_iterator
bool contains(const UT_StringRef &symbol) const
Check if a symbol exists.
void printTable(std::ostream &os)
bool empty() const
Check if the map is empty.
UT_SymbolMap< COP2_DebugTimingNode * > myTable
cop2_ScopedWatch(cop2_ThreadWatches &w, const char *name)
int printEntry(COP2_DebugTimingNode *&node, const char *, void *vdata)
COP2_DebugTimingNode(const char *nodepath)
GLubyte GLubyte GLubyte GLubyte w
int clearEntry(COP2_DebugTimingNode *&node, const char *, void *)