string ProfileSample::toString(void) const { StringStream msg; msg << m_Name //<< ",OpenCount:" << m_OpenCount << ",AverageTime:" << getAverageTime() << ",AccuTime:" << getAccumulatedTime() << ",CallCount:" << m_CallCount //<< ",ParentCount:" << m_ParentCount << ",ChildTime:" << getChildrenTime(); return msg.toString(); }
void PerformanceSample::print(int level, std::string recordName) const { std::string spaces = ""; for(int j=0; j<level; j++) spaces += ' '; float percent = 100.0f; if(parent_) percent = 100.0f * time_ / parent_->getTime(); float percentChildren = 100.0f * (getChildrenTime()) / time_; if (children_.size() > 0 && parent_) LINFO(spaces << recordName << name_ << " (" << children_.size() << " children): " << std::setprecision(10) << time_ << " secs (" << percent << "% of parent) (" << percentChildren << "% in children)"); else if (children_.size() > 0 && !parent_) LINFO(spaces << recordName << name_ << " (" << children_.size() << " children): " << std::setprecision(10) << time_ << " secs (" << percentChildren << "% in children)"); else if (children_.size() == 0 && parent_) LINFO(spaces << recordName << name_ << ": " << std::setprecision(10) << time_ << " secs (" << percent << "% of parent)"); else LINFO(spaces << recordName << name_ << ": " << std::setprecision(10) << time_ << " secs"); for(size_t i=0; i<children_.size(); i++) children_[i].print(level+1); }