X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2FSGPerfMon.cxx;h=ae8191b5a1278332a0bc92fa65c88f32a1ac9505;hb=691be54ca2b4d76f2e32f165c2513727c32a4de7;hp=43fab6d2a9492b229bd40741aab8a1fe79a5cb06;hpb=47c2dce26ddb4831c181506895f4574a94d755f4;p=simgear.git diff --git a/simgear/structure/SGPerfMon.cxx b/simgear/structure/SGPerfMon.cxx index 43fab6d2..ae8191b5 100644 --- a/simgear/structure/SGPerfMon.cxx +++ b/simgear/structure/SGPerfMon.cxx @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. // #ifdef HAVE_CONFIG_H @@ -52,8 +52,6 @@ SGPerformanceMonitor::bind(void) _statiticsSubsystems = _root->getChild("subsystems", 0, true); _statisticsFlag = _root->getChild("enabled", 0, true); _statisticsInterval = _root->getChild("interval-s", 0, true); -// _statiticsMinJitter = _root->getChild("min-jitter-ms", 0, true); -// _statiticsMinTime = _root->getChild("min-time-ms", 0, true); } void @@ -62,8 +60,6 @@ SGPerformanceMonitor::unbind(void) _statiticsSubsystems = 0; _statisticsFlag = 0; _statisticsInterval = 0; -// _statiticsMinJitter = 0; -// _statiticsMinTime = 0; } void @@ -80,7 +76,10 @@ SGPerformanceMonitor::update(double dt) // flag has changed, update subsystem manager _isEnabled = _statisticsFlag->getBoolValue(); if (_isEnabled) + { _subSysMgr->setReportTimingCb(this,&subSystemMgrHook); + _lastUpdate.stamp(); + } else _subSysMgr->setReportTimingCb(this,0); } @@ -110,12 +109,13 @@ SGPerformanceMonitor::reportTiming(const string& name, SampleStatistic* timeStat { SGPropertyNode* node = _statiticsSubsystems->getChild("subsystem",_count++,true); - double minMs = timeStat->min() / 1000; - double maxMs = timeStat->max() / 1000; - double meanMs = timeStat->mean() / 1000; - double stdDevMs = timeStat->stdDev() / 1000; - double totalMs = timeStat->total() / 1000; - int samples = timeStat->samples(); + double minMs = timeStat->min() / 1000; + double maxMs = timeStat->max() / 1000; + double meanMs = timeStat->mean() / 1000; + double stdDevMs = timeStat->stdDev() / 1000; + double totalMs = timeStat->total() / 1000; + double cumulativeMs = timeStat->cumulative() / 1000; + int samples = timeStat->samples(); node->setStringValue("name", name); node->setDoubleValue("min-ms", minMs); @@ -123,6 +123,7 @@ SGPerformanceMonitor::reportTiming(const string& name, SampleStatistic* timeStat node->setDoubleValue("mean-ms", meanMs); node->setDoubleValue("stddev-ms", stdDevMs); node->setDoubleValue("total-ms", totalMs); + node->setDoubleValue("cumulative-ms", cumulativeMs); node->setDoubleValue("count",samples); timeStat->reset();