//
// 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
#include <simgear/sg_inlines.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
-#include <simgear/sound/soundmgr_openal.hxx>
#include <simgear/structure/exception.hxx>
using std::string;
_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
_statiticsSubsystems = 0;
_statisticsFlag = 0;
_statisticsInterval = 0;
-// _statiticsMinJitter = 0;
-// _statiticsMinTime = 0;
}
void
// flag has changed, update subsystem manager
_isEnabled = _statisticsFlag->getBoolValue();
if (_isEnabled)
+ {
_subSysMgr->setReportTimingCb(this,&subSystemMgrHook);
+ _lastUpdate.stamp();
+ }
else
_subSysMgr->setReportTimingCb(this,0);
}
{
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);
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();