summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-07-16 19:15:46 -0700
committerRichard Linden <none@none>2012-07-16 19:15:46 -0700
commit5564fcb271d993b1b8a98fae7f832f47f1236fd4 (patch)
tree8f69250bff98ed43b386277e53475d5e9c2f6cce /indra/newview
parent5d32e23a11f272a2cdf8b6aac106534b6814ea98 (diff)
SH-3275 WIP Run viewer metrics for object update messages
clean up of llstats stuff
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/logcontrol.xml18
-rw-r--r--indra/newview/llfasttimerview.cpp12
-rw-r--r--indra/newview/llfasttimerview.h1
-rwxr-xr-xindra/newview/lltexturefetch.cpp9
-rw-r--r--indra/newview/llviewerobjectlist.cpp37
-rw-r--r--indra/newview/llviewerregion.cpp7
-rw-r--r--indra/newview/llviewerstats.cpp89
-rw-r--r--indra/newview/llviewerstats.h3
-rw-r--r--indra/newview/llviewerstatsrecorder.cpp179
-rw-r--r--indra/newview/llviewerstatsrecorder.h67
10 files changed, 196 insertions, 226 deletions
diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml
index 8636ba1090..92a241857e 100644
--- a/indra/newview/app_settings/logcontrol.xml
+++ b/indra/newview/app_settings/logcontrol.xml
@@ -48,24 +48,6 @@
-->
</array>
</map>
- <map>
- <key>level</key>
- <string>NONE</string>
- <key>functions</key>
- <array>
- </array>
- <key>classes</key>
- <array>
- <string>LLViewerStatsRecorder</string>
- </array>
- <key>files</key>
- <array>
- </array>
- <key>tags</key>
- <array>
-
- </array>
- </map>
</array>
</map>
</llsd>
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 9664aa7dbe..c032d5d049 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -95,7 +95,6 @@ LLFastTimerView::LLFastTimerView(const LLSD& key)
mHoverBarIndex = -1;
FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount();
mPrintStats = -1;
- mAverageCyclesPerTimer = 0;
}
void LLFastTimerView::onPause()
@@ -379,12 +378,6 @@ void LLFastTimerView::draw()
S32 xleft = margin;
S32 ytop = margin;
- mAverageCyclesPerTimer = LLFastTimer::sTimerCalls == 0
- ? 0
- : llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f));
- LLFastTimer::sTimerCycles = 0;
- LLFastTimer::sTimerCalls = 0;
-
// Draw some help
{
@@ -392,10 +385,6 @@ void LLFastTimerView::draw()
y = height - ytop;
texth = (S32)LLFontGL::getFontMonospace()->getLineHeight();
-#if TIME_FAST_TIMERS
- tdesc = llformat("Cycles per timer call: %d", mAverageCyclesPerTimer);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
-#else
char modedesc[][32] = {
"2 x Average ",
"Max ",
@@ -419,7 +408,6 @@ void LLFastTimerView::draw()
LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"),
0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
-#endif
y -= (texth + 2);
}
diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h
index a349e7ad4c..1fda91f173 100644
--- a/indra/newview/llfasttimerview.h
+++ b/indra/newview/llfasttimerview.h
@@ -90,7 +90,6 @@ private:
S32 mHoverBarIndex;
LLFrameTimer mHighlightTimer;
S32 mPrintStats;
- S32 mAverageCyclesPerTimer;
LLRect mGraphRect;
};
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 7e6dfbc9d9..143db79eb5 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -50,6 +50,7 @@
#include "llviewertexture.h"
#include "llviewerregion.h"
#include "llviewerstats.h"
+#include "llviewerstatsrecorder.h"
#include "llviewerassetstats.h"
#include "llworld.h"
#include "llsdutil.h"
@@ -1703,6 +1704,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
LL_DEBUGS("Texture") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL;
if (data_size > 0)
{
+ LLViewerStatsRecorder::instance().textureFetch(data_size);
// *TODO: set the formatted image data here directly to avoid the copy
mBuffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), data_size);
buffer->readAfter(channels.in(), NULL, mBuffer, data_size);
@@ -1736,6 +1738,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
mLoaded = TRUE;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
+ LLViewerStatsRecorder::instance().log(0.2f);
return data_size ;
}
@@ -2639,6 +2642,9 @@ bool LLTextureFetch::receiveImageHeader(const LLHost& host, const LLUUID& id, U8
return false;
}
+ LLViewerStatsRecorder::instance().textureFetch(data_size);
+ LLViewerStatsRecorder::instance().log(0.1f);
+
worker->lockWorkMutex();
// Copy header data into image object
@@ -2685,6 +2691,9 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
return false;
}
+ LLViewerStatsRecorder::instance().textureFetch(data_size);
+ LLViewerStatsRecorder::instance().log(0.1f);
+
worker->lockWorkMutex();
res = worker->insertPacket(packet_num, data, data_size);
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index b010ac9aa7..5a23b55fa7 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -347,9 +347,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
LLDataPackerBinaryBuffer compressed_dp(compressed_dpbuffer, 2048);
LLDataPacker *cached_dpp = NULL;
LLViewerStatsRecorder& recorder = LLViewerStatsRecorder::instance();
-#if LL_RECORD_VIEWER_STATS
- recorder.beginObjectUpdateEvents(1.f);
-#endif
for (i = 0; i < num_objects; i++)
{
@@ -380,9 +377,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
else
{
// Cache Miss.
-#if LL_RECORD_VIEWER_STATS
- recorder.recordCacheMissEvent(id, update_type, cache_miss_type, msg_size);
-#endif
+ recorder.cacheMissEvent(id, update_type, cache_miss_type, msg_size);
continue; // no data packer, skip this object
}
@@ -509,9 +504,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (update_type == OUT_TERSE_IMPROVED)
{
// llinfos << "terse update for an unknown object (compressed):" << fullid << llendl;
- #if LL_RECORD_VIEWER_STATS
- recorder.recordObjectUpdateFailure(local_id, update_type, msg_size);
- #endif
+ recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
}
@@ -523,9 +516,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (update_type != OUT_FULL)
{
//llinfos << "terse update for an unknown object:" << fullid << llendl;
- #if LL_RECORD_VIEWER_STATS
- recorder.recordObjectUpdateFailure(local_id, update_type, msg_size);
- #endif
+ recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -538,9 +529,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
mNumDeadObjectUpdates++;
//llinfos << "update for a dead object:" << fullid << llendl;
- #if LL_RECORD_VIEWER_STATS
- recorder.recordObjectUpdateFailure(local_id, update_type, msg_size);
- #endif
+ recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
#endif
@@ -549,9 +538,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (!objectp)
{
llinfos << "createObject failure for object: " << fullid << llendl;
- #if LL_RECORD_VIEWER_STATS
- recorder.recordObjectUpdateFailure(local_id, update_type, msg_size);
- #endif
+ recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
justCreated = TRUE;
@@ -577,12 +564,8 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
{
bCached = true;
- #if LL_RECORD_VIEWER_STATS
LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp);
- recorder.recordCacheFullUpdate(local_id, update_type, result, objectp, msg_size);
- #else
- objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp);
- #endif
+ recorder.cacheFullUpdate(local_id, update_type, result, objectp, msg_size);
}
}
else if (cached) // Cache hit only?
@@ -598,16 +581,12 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
}
processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated);
}
- #if LL_RECORD_VIEWER_STATS
- recorder.recordObjectUpdateEvent(local_id, update_type, objectp, msg_size);
- #endif
+ recorder.objectUpdateEvent(local_id, update_type, objectp, msg_size);
objectp->setLastUpdateType(update_type);
objectp->setLastUpdateCached(bCached);
}
-#if LL_RECORD_VIEWER_STATS
- recorder.endObjectUpdateEvents();
-#endif
+ recorder.log(0.2f);
LLVOAvatar::cullAvatarsByPixelArea();
}
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 0e2927cea4..44377b1f3e 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1317,11 +1317,8 @@ void LLViewerRegion::requestCacheMisses()
mCacheDirty = TRUE ;
// llinfos << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << llendl;
- #if LL_RECORD_VIEWER_STATS
- LLViewerStatsRecorder::instance().beginObjectUpdateEvents(1.f);
- LLViewerStatsRecorder::instance().recordRequestCacheMissesEvent(full_count + crc_count);
- LLViewerStatsRecorder::instance().endObjectUpdateEvents();
- #endif
+ LLViewerStatsRecorder::instance().requestCacheMissesEvent(full_count + crc_count);
+ LLViewerStatsRecorder::instance().log(0.2f);
}
void LLViewerRegion::dumpCache()
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 497e95c5e3..c1ccfe3faa 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -323,55 +323,55 @@ void LLViewerStats::updateFrameStats(const F64 time_diff)
{
if (mPacketsLostPercentStat.getCurrent() > 5.0)
{
- incStat(LLViewerStats::ST_LOSS_05_SECONDS, time_diff);
+ incStat(ST_LOSS_05_SECONDS, time_diff);
}
if (mSimFPS.getCurrent() < 20.f && mSimFPS.getCurrent() > 0.f)
{
- incStat(LLViewerStats::ST_SIM_FPS_20_SECONDS, time_diff);
+ incStat(ST_SIM_FPS_20_SECONDS, time_diff);
}
if (mSimPhysicsFPS.getCurrent() < 20.f && mSimPhysicsFPS.getCurrent() > 0.f)
{
- incStat(LLViewerStats::ST_PHYS_FPS_20_SECONDS, time_diff);
+ incStat(ST_PHYS_FPS_20_SECONDS, time_diff);
}
if (time_diff >= 0.5)
{
- incStat(LLViewerStats::ST_FPS_2_SECONDS, time_diff);
+ incStat(ST_FPS_2_SECONDS, time_diff);
}
if (time_diff >= 0.125)
{
- incStat(LLViewerStats::ST_FPS_8_SECONDS, time_diff);
+ incStat(ST_FPS_8_SECONDS, time_diff);
}
if (time_diff >= 0.1)
{
- incStat(LLViewerStats::ST_FPS_10_SECONDS, time_diff);
+ incStat(ST_FPS_10_SECONDS, time_diff);
}
if (gFrameCount && mLastTimeDiff > 0.0)
{
// new "stutter" meter
- setStat(LLViewerStats::ST_FPS_DROP_50_RATIO,
- (getStat(LLViewerStats::ST_FPS_DROP_50_RATIO) * (F64)(gFrameCount - 1) +
+ setStat(ST_FPS_DROP_50_RATIO,
+ (getStat(ST_FPS_DROP_50_RATIO) * (F64)(gFrameCount - 1) +
(time_diff >= 2.0 * mLastTimeDiff ? 1.0 : 0.0)) / gFrameCount);
// old stats that were never really used
- setStat(LLViewerStats::ST_FRAMETIME_JITTER,
- (getStat(LLViewerStats::ST_FRAMETIME_JITTER) * (gFrameCount - 1) +
+ setStat(ST_FRAMETIME_JITTER,
+ (getStat(ST_FRAMETIME_JITTER) * (gFrameCount - 1) +
fabs(mLastTimeDiff - time_diff) / mLastTimeDiff) / gFrameCount);
F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount;
- setStat(LLViewerStats::ST_FRAMETIME_SLEW,
- (getStat(LLViewerStats::ST_FRAMETIME_SLEW) * (gFrameCount - 1) +
+ setStat(ST_FRAMETIME_SLEW,
+ (getStat(ST_FRAMETIME_SLEW) * (gFrameCount - 1) +
fabs(average_frametime - time_diff) / average_frametime) / gFrameCount);
F32 max_bandwidth = gViewerThrottle.getMaxBandwidth();
F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth;
- setStat(LLViewerStats::ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f);
+ setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f);
- setStat(LLViewerStats::ST_MAX_BANDWIDTH, max_bandwidth / 1024.f);
+ setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f);
}
@@ -399,19 +399,6 @@ void LLViewerStats::addToMessage(LLSD &body) const
<< "; Count = " << mAgentPositionSnaps.getCount() << llendl;
}
-// static
-// const std::string LLViewerStats::statTypeToText(EStatType type)
-// {
-// if (type >= 0 && type < ST_COUNT)
-// {
-// return STAT_INFO[type].mName;
-// }
-// else
-// {
-// return "Unknown statistic";
-// }
-// }
-
// *NOTE:Mani The following methods used to exist in viewer.cpp
// Moving them here, but not merging them into LLViewerStats yet.
void reset_statistics()
@@ -579,6 +566,8 @@ void update_statistics(U32 frame_count)
gTotalWorldBytes += gVLManager.getTotalBytes();
gTotalObjectBytes += gObjectBits / 8;
+ LLViewerStats& stats = LLViewerStats::instance();
+
// make sure we have a valid time delta for this frame
if (gFrameIntervalSeconds > 0.f)
{
@@ -595,42 +584,42 @@ void update_statistics(U32 frame_count)
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds);
}
}
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail());
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles"));
+ stats.setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
+ stats.setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail());
+ stats.setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
+ stats.setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles"));
#if 0 // 1.9.2
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject"));
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar"));
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment"));
+ stats.setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject"));
+ stats.setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar"));
+ stats.setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment"));
#endif
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime("Frame"));
+ stats.setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime("Frame"));
F64 idle_secs = gDebugView->mFastTimerView->getTime("Idle");
F64 network_secs = gDebugView->mFastTimerView->getTime("Network");
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs);
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs);
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime("Update Images"));
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime("Sort Draw State"));
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime("Geometry"));
+ stats.setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs);
+ stats.setStat(LLViewerStats::ST_NETWORK_SECS, network_secs);
+ stats.setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime("Update Images"));
+ stats.setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime("Sort Draw State"));
+ stats.setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime("Geometry"));
LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost());
if (cdp)
{
- LLViewerStats::getInstance()->mSimPingStat.addValue(cdp->getPingDelay());
+ stats.mSimPingStat.addValue(cdp->getPingDelay());
gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1);
gSimPingCount++;
}
else
{
- LLViewerStats::getInstance()->mSimPingStat.addValue(10000);
+ stats.mSimPingStat.addValue(10000);
}
- LLViewerStats::getInstance()->mFPSStat.addValue(1);
+ stats.mFPSStat.addValue(1);
F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
- LLViewerStats::getInstance()->mLayersKBitStat.addValue(layer_bits/1024.f);
- LLViewerStats::getInstance()->mObjectKBitStat.addValue(gObjectBits/1024.f);
- LLViewerStats::getInstance()->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
- LLViewerStats::getInstance()->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
+ stats.mLayersKBitStat.addValue(layer_bits/1024.f);
+ stats.mObjectKBitStat.addValue(gObjectBits/1024.f);
+ stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
+ stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
@@ -651,7 +640,7 @@ void update_statistics(U32 frame_count)
visible_avatar_frames = 1.f;
avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames;
}
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars);
+ stats.setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars);
}
LLWorld::getInstance()->updateNetStats();
LLWorld::getInstance()->requestCacheMisses();
@@ -667,8 +656,8 @@ void update_statistics(U32 frame_count)
static LLFrameTimer texture_stats_timer;
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
{
- LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f);
- LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets);
+ stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f);
+ stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets);
gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8;
LLViewerTextureList::sTextureBits = 0;
LLViewerTextureList::sTexturePackets = 0;
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 750d963f69..9a2a33fa7b 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -112,8 +112,7 @@ public:
void resetStats();
public:
- // If you change this, please also add a corresponding text label
- // in statTypeToText in llviewerstats.cpp
+ // If you change this, please also add a corresponding text label in llviewerstats.cpp
enum EStatType
{
ST_VERSION = 0,
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp
index cfb446fe45..91e485d01b 100644
--- a/indra/newview/llviewerstatsrecorder.cpp
+++ b/indra/newview/llviewerstatsrecorder.cpp
@@ -27,7 +27,6 @@
#include "llviewerprecompiledheaders.h"
#include "llviewerstatsrecorder.h"
-#if LL_RECORD_VIEWER_STATS
#include "llfile.h"
#include "llviewerregion.h"
@@ -46,8 +45,6 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() :
mObjectCacheFile(NULL),
mTimer(),
mStartTime(0.0),
- mProcessingStartTime(0.0),
- mProcessingTotalTime(0.0),
mLastSnapshotTime(0.0)
{
if (NULL != sInstance)
@@ -63,50 +60,12 @@ LLViewerStatsRecorder::~LLViewerStatsRecorder()
if (mObjectCacheFile != NULL)
{
// last chance snapshot
- takeSnapshot();
+ writeToLog(0.f);
LLFile::close(mObjectCacheFile);
mObjectCacheFile = NULL;
}
}
-void LLViewerStatsRecorder::beginObjectUpdateEvents(F32 interval)
-{
- mSnapshotInterval = interval;
- if (mObjectCacheFile == NULL)
- {
- mStartTime = LLTimer::getTotalSeconds();
- mObjectCacheFile = LLFile::fopen(STATS_FILE_NAME, "wb");
- if (mObjectCacheFile)
- { // Write column headers
- std::ostringstream data_msg;
- data_msg << "EventTime(ms), "
- << "Processing Time(ms), "
- << "Cache Hits, "
- << "Cache Full Misses, "
- << "Cache Crc Misses, "
- << "Full Updates, "
- << "Terse Updates, "
- << "Cache Miss Requests, "
- << "Cache Miss Responses, "
- << "Cache Update Dupes, "
- << "Cache Update Changes, "
- << "Cache Update Adds, "
- << "Cache Update Replacements, "
- << "Update Failures, "
- << "Cache Hits bps, "
- << "Cache Full Misses bps, "
- << "Cache Crc Misses bps, "
- << "Full Updates bps, "
- << "Terse Updates bps, "
- << "Cache Miss Responses bps, "
- << "\n";
-
- fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile );
- }
- }
- mProcessingStartTime = LLTimer::getTotalSeconds();
-}
-
void LLViewerStatsRecorder::clearStats()
{
mObjectCacheHitCount = 0;
@@ -128,6 +87,7 @@ void LLViewerStatsRecorder::clearStats()
mObjectCacheUpdateReplacements = 0;
mObjectUpdateFailures = 0;
mObjectUpdateFailuresSize = 0;
+ mTextureFetchSize = 0;
}
@@ -204,69 +164,93 @@ void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count)
mObjectCacheMissRequests += count;
}
-void LLViewerStatsRecorder::endObjectUpdateEvents()
-{
- mProcessingTotalTime += LLTimer::getTotalSeconds() - mProcessingStartTime;
- takeSnapshot();
-}
-
-void LLViewerStatsRecorder::takeSnapshot()
+void LLViewerStatsRecorder::writeToLog( F32 interval )
{
F64 delta_time = LLTimer::getTotalSeconds() - mLastSnapshotTime;
- if ( delta_time > mSnapshotInterval)
- {
- mLastSnapshotTime = LLTimer::getTotalSeconds();
- llinfos << "ILX: "
- << mObjectCacheHitCount << " hits, "
- << mObjectCacheMissFullCount << " full misses, "
- << mObjectCacheMissCrcCount << " crc misses, "
- << mObjectFullUpdates << " full updates, "
- << mObjectTerseUpdates << " terse updates, "
- << mObjectCacheMissRequests << " cache miss requests, "
- << mObjectCacheMissResponses << " cache miss responses, "
- << mObjectCacheUpdateDupes << " cache update dupes, "
- << mObjectCacheUpdateChanges << " cache update changes, "
- << mObjectCacheUpdateAdds << " cache update adds, "
- << mObjectCacheUpdateReplacements << " cache update replacements, "
- << mObjectUpdateFailures << " update failures"
- << llendl;
+ S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures;
- S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures;
- if (mObjectCacheFile != NULL &&
- total_objects > 0)
- {
- std::ostringstream data_msg;
+ if ( delta_time < interval || total_objects == 0) return;
- F32 processing32 = (F32) mProcessingTotalTime;
- mProcessingTotalTime = 0.0;
+ mLastSnapshotTime = LLTimer::getTotalSeconds();
+ lldebugs << "ILX: "
+ << mObjectCacheHitCount << " hits, "
+ << mObjectCacheMissFullCount << " full misses, "
+ << mObjectCacheMissCrcCount << " crc misses, "
+ << mObjectFullUpdates << " full updates, "
+ << mObjectTerseUpdates << " terse updates, "
+ << mObjectCacheMissRequests << " cache miss requests, "
+ << mObjectCacheMissResponses << " cache miss responses, "
+ << mObjectCacheUpdateDupes << " cache update dupes, "
+ << mObjectCacheUpdateChanges << " cache update changes, "
+ << mObjectCacheUpdateAdds << " cache update adds, "
+ << mObjectCacheUpdateReplacements << " cache update replacements, "
+ << mObjectUpdateFailures << " update failures"
+ << llendl;
- data_msg << getTimeSinceStart()
- << ", " << processing32
- << ", " << mObjectCacheHitCount
- << ", " << mObjectCacheMissFullCount
- << ", " << mObjectCacheMissCrcCount
- << ", " << mObjectFullUpdates
- << ", " << mObjectTerseUpdates
- << ", " << mObjectCacheMissRequests
- << ", " << mObjectCacheMissResponses
- << ", " << mObjectCacheUpdateDupes
- << ", " << mObjectCacheUpdateChanges
- << ", " << mObjectCacheUpdateAdds
- << ", " << mObjectCacheUpdateReplacements
- << ", " << mObjectUpdateFailures
- << ", " << (mObjectCacheHitSize * 8 / delta_time)
- << ", " << (mObjectCacheMissFullSize * 8 / delta_time)
- << ", " << (mObjectCacheMissCrcSize * 8 / delta_time)
- << ", " << (mObjectFullUpdatesSize * 8 / delta_time)
- << ", " << (mObjectTerseUpdatesSize * 8 / delta_time)
- << ", " << (mObjectCacheMissResponsesSize * 8 / delta_time)
+ if (mObjectCacheFile == NULL)
+ {
+ mStartTime = LLTimer::getTotalSeconds();
+ mObjectCacheFile = LLFile::fopen(STATS_FILE_NAME, "wb");
+ if (mObjectCacheFile)
+ { // Write column headers
+ std::ostringstream data_msg;
+ data_msg << "EventTime(ms)\t"
+ << "Cache Hits\t"
+ << "Cache Full Misses\t"
+ << "Cache Crc Misses\t"
+ << "Full Updates\t"
+ << "Terse Updates\t"
+ << "Cache Miss Requests\t"
+ << "Cache Miss Responses\t"
+ << "Cache Update Dupes\t"
+ << "Cache Update Changes\t"
+ << "Cache Update Adds\t"
+ << "Cache Update Replacements\t"
+ << "Update Failures\t"
+ << "Cache Hits bps\t"
+ << "Cache Full Misses bps\t"
+ << "Cache Crc Misses bps\t"
+ << "Full Updates bps\t"
+ << "Terse Updates bps\t"
+ << "Cache Miss Responses bps\t"
+ << "Texture Fetch bps\t"
<< "\n";
fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile );
}
-
- clearStats();
+ else
+ {
+ llwarns << "Couldn't open " << STATS_FILE_NAME << " for logging." << llendl;
+ return;
+ }
}
+
+ std::ostringstream data_msg;
+
+ data_msg << getTimeSinceStart()
+ << "\t " << mObjectCacheHitCount
+ << "\t" << mObjectCacheMissFullCount
+ << "\t" << mObjectCacheMissCrcCount
+ << "\t" << mObjectFullUpdates
+ << "\t" << mObjectTerseUpdates
+ << "\t" << mObjectCacheMissRequests
+ << "\t" << mObjectCacheMissResponses
+ << "\t" << mObjectCacheUpdateDupes
+ << "\t" << mObjectCacheUpdateChanges
+ << "\t" << mObjectCacheUpdateAdds
+ << "\t" << mObjectCacheUpdateReplacements
+ << "\t" << mObjectUpdateFailures
+ << "\t" << (mObjectCacheHitSize * 8 / delta_time)
+ << "\t" << (mObjectCacheMissFullSize * 8 / delta_time)
+ << "\t" << (mObjectCacheMissCrcSize * 8 / delta_time)
+ << "\t" << (mObjectFullUpdatesSize * 8 / delta_time)
+ << "\t" << (mObjectTerseUpdatesSize * 8 / delta_time)
+ << "\t" << (mObjectCacheMissResponsesSize * 8 / delta_time)
+ << "\t" << (mTextureFetchSize * 8 / delta_time)
+ << "\n";
+
+ fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile );
+ clearStats();
}
F32 LLViewerStatsRecorder::getTimeSinceStart()
@@ -274,7 +258,10 @@ F32 LLViewerStatsRecorder::getTimeSinceStart()
return (F32) (LLTimer::getTotalSeconds() - mStartTime);
}
-#endif
+void LLViewerStatsRecorder::recordTextureFetch( S32 msg_size )
+{
+ mTextureFetchSize += msg_size;
+}
diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h
index 09530b13eb..ce6dd63ec5 100644
--- a/indra/newview/llviewerstatsrecorder.h
+++ b/indra/newview/llviewerstatsrecorder.h
@@ -35,7 +35,6 @@
#define LL_RECORD_VIEWER_STATS 1
-#if LL_RECORD_VIEWER_STATS
#include "llframetimer.h"
#include "llviewerobject.h"
#include "llviewerregion.h"
@@ -50,29 +49,71 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder>
LLViewerStatsRecorder();
~LLViewerStatsRecorder();
- void beginObjectUpdateEvents(F32 interval);
+ void objectUpdateFailure(U32 local_id, const EObjectUpdateType update_type, S32 msg_size)
+ {
+#if LL_RECORD_VIEWER_STATS
+ recordObjectUpdateFailure(local_id, update_type, msg_size);
+#endif
+ }
+
+ void cacheMissEvent(U32 local_id, const EObjectUpdateType update_type, U8 cache_miss_type, S32 msg_size)
+ {
+#if LL_RECORD_VIEWER_STATS
+ recordCacheMissEvent(local_id, update_type, cache_miss_type, msg_size);
+#endif
+ }
+
+ void objectUpdateEvent(U32 local_id, const EObjectUpdateType update_type, LLViewerObject * objectp, S32 msg_size)
+ {
+#if LL_RECORD_VIEWER_STATS
+ recordObjectUpdateEvent(local_id, update_type, objectp, msg_size);
+#endif
+ }
+ void cacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp, S32 msg_size)
+ {
+#if LL_RECORD_VIEWER_STATS
+ recordCacheFullUpdate(local_id, update_type, update_result, objectp, msg_size);
+#endif
+ }
+
+ void requestCacheMissesEvent(S32 count)
+ {
+#if LL_RECORD_VIEWER_STATS
+ recordRequestCacheMissesEvent(count);
+#endif
+ }
+
+ void textureFetch(S32 msg_size)
+ {
+#if LL_RECORD_VIEWER_STATS
+ recordTextureFetch(msg_size);
+#endif
+ }
+
+ void log(F32 interval)
+ {
+#if LL_RECORD_VIEWER_STATS
+ writeToLog(interval);
+#endif
+ }
+
+ F32 getTimeSinceStart();
+
+private:
void recordObjectUpdateFailure(U32 local_id, const EObjectUpdateType update_type, S32 msg_size);
void recordCacheMissEvent(U32 local_id, const EObjectUpdateType update_type, U8 cache_miss_type, S32 msg_size);
void recordObjectUpdateEvent(U32 local_id, const EObjectUpdateType update_type, LLViewerObject * objectp, S32 msg_size);
void recordCacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp, S32 msg_size);
void recordRequestCacheMissesEvent(S32 count);
-
- void endObjectUpdateEvents();
-
- F32 getTimeSinceStart();
-
-private:
- void takeSnapshot();
+ void recordTextureFetch(S32 msg_size);
+ void writeToLog(F32 interval);
static LLViewerStatsRecorder* sInstance;
LLFILE * mObjectCacheFile; // File to write data into
LLFrameTimer mTimer;
F64 mStartTime;
- F64 mProcessingStartTime;
- F64 mProcessingTotalTime;
- F64 mSnapshotInterval;
F64 mLastSnapshotTime;
S32 mObjectCacheHitCount;
@@ -94,11 +135,11 @@ private:
S32 mObjectCacheUpdateReplacements;
S32 mObjectUpdateFailures;
S32 mObjectUpdateFailuresSize;
+ S32 mTextureFetchSize;
void clearStats();
};
-#endif // LL_RECORD_VIEWER_STATS
#endif // LLVIEWERSTATSRECORDER_H