aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerstats.cpp')
-rw-r--r--linden/indra/newview/llviewerstats.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp
index d12d51c..93e69ca 100644
--- a/linden/indra/newview/llviewerstats.cpp
+++ b/linden/indra/newview/llviewerstats.cpp
@@ -501,12 +501,18 @@ extern U32 gVisCompared;
501extern U32 gVisTested; 501extern U32 gVisTested;
502 502
503std::map<S32,LLFrameTimer> gDebugTimers; 503std::map<S32,LLFrameTimer> gDebugTimers;
504std::map<S32,std::string> gDebugTimerLabel;
505
506void init_statistics()
507{
508 // Label debug timers
509 gDebugTimerLabel[0] = "Texture";
510}
504 511
505void update_statistics(U32 frame_count) 512void update_statistics(U32 frame_count)
506{ 513{
507 gTotalWorldBytes += gVLManager.getTotalBytes(); 514 gTotalWorldBytes += gVLManager.getTotalBytes();
508 gTotalObjectBytes += gObjectBits / 8; 515 gTotalObjectBytes += gObjectBits / 8;
509 gTotalTextureBytes += LLViewerImageList::sTextureBits / 8;
510 516
511 // make sure we have a valid time delta for this frame 517 // make sure we have a valid time delta for this frame
512 if (gFrameIntervalSeconds > 0.f) 518 if (gFrameIntervalSeconds > 0.f)
@@ -558,7 +564,6 @@ void update_statistics(U32 frame_count)
558 F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); 564 F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
559 LLViewerStats::getInstance()->mLayersKBitStat.addValue(layer_bits/1024.f); 565 LLViewerStats::getInstance()->mLayersKBitStat.addValue(layer_bits/1024.f);
560 LLViewerStats::getInstance()->mObjectKBitStat.addValue(gObjectBits/1024.f); 566 LLViewerStats::getInstance()->mObjectKBitStat.addValue(gObjectBits/1024.f);
561 LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f);
562 LLViewerStats::getInstance()->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); 567 LLViewerStats::getInstance()->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
563 LLViewerStats::getInstance()->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); 568 LLViewerStats::getInstance()->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
564 gTransferManager.resetTransferBitsIn(LLTCT_ASSET); 569 gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
@@ -572,8 +577,6 @@ void update_statistics(U32 frame_count)
572 gDebugTimers[0].unpause(); 577 gDebugTimers[0].unpause();
573 } 578 }
574 579
575 LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets);
576
577 { 580 {
578 static F32 visible_avatar_frames = 0.f; 581 static F32 visible_avatar_frames = 0.f;
579 static F32 avg_visible_avatars = 0; 582 static F32 avg_visible_avatars = 0;
@@ -593,8 +596,20 @@ void update_statistics(U32 frame_count)
593 gObjectBits = 0; 596 gObjectBits = 0;
594// gDecodedBits = 0; 597// gDecodedBits = 0;
595 598
596 LLViewerImageList::sTextureBits = 0; 599 // Only update texture stats ones per second so that they are less noisy
597 LLViewerImageList::sTexturePackets = 0; 600 {
601 static const F32 texture_stats_freq = 1.f;
602 static LLFrameTimer texture_stats_timer;
603 if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
604 {
605 LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f);
606 LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets);
607 gTotalTextureBytes += LLViewerImageList::sTextureBits / 8;
608 LLViewerImageList::sTextureBits = 0;
609 LLViewerImageList::sTexturePackets = 0;
610 texture_stats_timer.reset();
611 }
612 }
598 613
599#if LL_LCD_COMPILE 614#if LL_LCD_COMPILE
600 bool LCDenabled = gLcdScreen->Enabled(); 615 bool LCDenabled = gLcdScreen->Enabled();
@@ -775,3 +790,4 @@ void send_stats()
775 LLViewerStats::getInstance()->addToMessage(body); 790 LLViewerStats::getInstance()->addToMessage(body);
776 LLHTTPClient::post(url, body, new ViewerStatsResponder()); 791 LLHTTPClient::post(url, body, new ViewerStatsResponder());
777} 792}
793