本文整理汇总了C++中LLViewerRegion::updateNetStats方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::updateNetStats方法的具体用法?C++ LLViewerRegion::updateNetStats怎么用?C++ LLViewerRegion::updateNetStats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::updateNetStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateNetStats
void LLWorld::updateNetStats()
{
F32 bits = 0.f;
U32 packets = 0;
for (region_list_t::iterator iter = mActiveRegionList.begin();
iter != mActiveRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
regionp->updateNetStats();
bits += regionp->mBitStat.getCurrent();
packets += llfloor( regionp->mPacketsStat.getCurrent() );
}
S32 packets_in = gMessageSystem->mPacketsIn - mLastPacketsIn;
S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut;
S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost;
S32 actual_in_bits = gMessageSystem->mPacketRing->getAndResetActualInBits();
S32 actual_out_bits = gMessageSystem->mPacketRing->getAndResetActualOutBits();
LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f);
LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f);
LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f);
LLViewerStats::getInstance()->mPacketsInStat.addValue(packets_in);
LLViewerStats::getInstance()->mPacketsOutStat.addValue(packets_out);
LLViewerStats::getInstance()->mPacketsLostStat.addValue(gMessageSystem->mDroppedPackets);
if (packets_in)
{
LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(100.f*((F32)packets_lost/(F32)packets_in));
}
else
{
LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(0.f);
}
mLastPacketsIn = gMessageSystem->mPacketsIn;
mLastPacketsOut = gMessageSystem->mPacketsOut;
mLastPacketsLost = gMessageSystem->mDroppedPackets;
}