X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2FSGPerfMon.cxx;h=ae8191b5a1278332a0bc92fa65c88f32a1ac9505;hb=691be54ca2b4d76f2e32f165c2513727c32a4de7;hp=806ebe985bd8464e879915ae8a2bed323cf1b547;hpb=338f2311d45f0a1c0328524cdf1e0c040e714b96;p=simgear.git diff --git a/simgear/structure/SGPerfMon.cxx b/simgear/structure/SGPerfMon.cxx index 806ebe98..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 @@ -34,7 +34,6 @@ #include #include #include -#include #include using std::string; @@ -53,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 @@ -63,8 +60,6 @@ SGPerformanceMonitor::unbind(void) _statiticsSubsystems = 0; _statisticsFlag = 0; _statisticsInterval = 0; -// _statiticsMinJitter = 0; -// _statiticsMinTime = 0; } void @@ -81,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); } @@ -111,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); @@ -124,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();