aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerstats.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llviewerstats.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerstats.cpp91
1 files changed, 45 insertions, 46 deletions
diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp
index dabc971..9f10bbf 100644
--- a/linden/indra/newview/llviewerstats.cpp
+++ b/linden/indra/newview/llviewerstats.cpp
@@ -59,7 +59,6 @@
59 #include "lllcd.h" 59 #include "lllcd.h"
60#endif 60#endif
61 61
62LLViewerStats *gViewerStats = NULL;
63 62
64class StatAttributes 63class StatAttributes
65{ 64{
@@ -223,17 +222,17 @@ LLViewerStats::~LLViewerStats()
223 222
224void LLViewerStats::resetStats() 223void LLViewerStats::resetStats()
225{ 224{
226 gViewerStats->mKBitStat.reset(); 225 LLViewerStats::getInstance()->mKBitStat.reset();
227 gViewerStats->mLayersKBitStat.reset(); 226 LLViewerStats::getInstance()->mLayersKBitStat.reset();
228 gViewerStats->mObjectKBitStat.reset(); 227 LLViewerStats::getInstance()->mObjectKBitStat.reset();
229 gViewerStats->mTextureKBitStat.reset(); 228 LLViewerStats::getInstance()->mTextureKBitStat.reset();
230 gViewerStats->mVFSPendingOperations.reset(); 229 LLViewerStats::getInstance()->mVFSPendingOperations.reset();
231 gViewerStats->mAssetKBitStat.reset(); 230 LLViewerStats::getInstance()->mAssetKBitStat.reset();
232 gViewerStats->mPacketsInStat.reset(); 231 LLViewerStats::getInstance()->mPacketsInStat.reset();
233 gViewerStats->mPacketsLostStat.reset(); 232 LLViewerStats::getInstance()->mPacketsLostStat.reset();
234 gViewerStats->mPacketsOutStat.reset(); 233 LLViewerStats::getInstance()->mPacketsOutStat.reset();
235 gViewerStats->mFPSStat.reset(); 234 LLViewerStats::getInstance()->mFPSStat.reset();
236 gViewerStats->mTexturePacketsStat.reset(); 235 LLViewerStats::getInstance()->mTexturePacketsStat.reset();
237} 236}
238 237
239 238
@@ -511,54 +510,54 @@ void update_statistics(U32 frame_count)
511 { 510 {
512 if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) 511 if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK)
513 { 512 {
514 gViewerStats->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); 513 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds);
515 } 514 }
516 else if (gAgent.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) 515 else if (gAgent.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR)
517 { 516 {
518 gViewerStats->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); 517 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds);
519 } 518 }
520 else if (gFloaterTools && gFloaterTools->getVisible()) 519 else if (gFloaterTools && gFloaterTools->getVisible())
521 { 520 {
522 gViewerStats->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); 521 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds);
523 } 522 }
524 } 523 }
525 gViewerStats->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); 524 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
526 gViewerStats->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); 525 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail"));
527 gViewerStats->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); 526 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
528 gViewerStats->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); 527 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles"));
529#if 0 // 1.9.2 528#if 0 // 1.9.2
530 gViewerStats->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject")); 529 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject"));
531 gViewerStats->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); 530 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar"));
532 gViewerStats->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment")); 531 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment"));
533#endif 532#endif
534 gViewerStats->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME)); 533 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME));
535 F64 idle_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IDLE); 534 F64 idle_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IDLE);
536 F64 network_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_NETWORK); 535 F64 network_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_NETWORK);
537 gViewerStats->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); 536 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs);
538 gViewerStats->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs); 537 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs);
539 gViewerStats->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IMAGE_UPDATE)); 538 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IMAGE_UPDATE));
540 gViewerStats->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_STATESORT )); 539 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_STATESORT ));
541 gViewerStats->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_RENDER_GEOMETRY)); 540 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_RENDER_GEOMETRY));
542 541
543 LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); 542 LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost());
544 if (cdp) 543 if (cdp)
545 { 544 {
546 gViewerStats->mSimPingStat.addValue(cdp->getPingDelay()); 545 LLViewerStats::getInstance()->mSimPingStat.addValue(cdp->getPingDelay());
547 gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); 546 gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1);
548 gSimPingCount++; 547 gSimPingCount++;
549 } 548 }
550 else 549 else
551 { 550 {
552 gViewerStats->mSimPingStat.addValue(10000); 551 LLViewerStats::getInstance()->mSimPingStat.addValue(10000);
553 } 552 }
554 553
555 gViewerStats->mFPSStat.addValue(1); 554 LLViewerStats::getInstance()->mFPSStat.addValue(1);
556 F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); 555 F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
557 gViewerStats->mLayersKBitStat.addValue(layer_bits/1024.f); 556 LLViewerStats::getInstance()->mLayersKBitStat.addValue(layer_bits/1024.f);
558 gViewerStats->mObjectKBitStat.addValue(gObjectBits/1024.f); 557 LLViewerStats::getInstance()->mObjectKBitStat.addValue(gObjectBits/1024.f);
559 gViewerStats->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f); 558 LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f);
560 gViewerStats->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); 559 LLViewerStats::getInstance()->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
561 gViewerStats->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); 560 LLViewerStats::getInstance()->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
562 gTransferManager.resetTransferBitsIn(LLTCT_ASSET); 561 gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
563 562
564 static S32 tex_bits_idle_count = 0; 563 static S32 tex_bits_idle_count = 0;
@@ -573,7 +572,7 @@ void update_statistics(U32 frame_count)
573 gDebugTimers[0].unpause(); 572 gDebugTimers[0].unpause();
574 } 573 }
575 574
576 gViewerStats->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); 575 LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets);
577 576
578 { 577 {
579 static F32 visible_avatar_frames = 0.f; 578 static F32 visible_avatar_frames = 0.f;
@@ -584,10 +583,10 @@ void update_statistics(U32 frame_count)
584 visible_avatar_frames = 1.f; 583 visible_avatar_frames = 1.f;
585 avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames; 584 avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames;
586 } 585 }
587 gViewerStats->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); 586 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars);
588 } 587 }
589 gWorldp->updateNetStats(); 588 LLWorld::getInstance()->updateNetStats();
590 gWorldp->requestCacheMisses(); 589 LLWorld::getInstance()->requestCacheMisses();
591 590
592 // Reset all of these values. 591 // Reset all of these values.
593 gVLManager.resetBitCounts(); 592 gVLManager.resetBitCounts();
@@ -599,9 +598,9 @@ void update_statistics(U32 frame_count)
599 598
600#if LL_WINDOWS && LL_LCD_COMPILE 599#if LL_WINDOWS && LL_LCD_COMPILE
601 bool LCDenabled = gLcdScreen->Enabled(); 600 bool LCDenabled = gLcdScreen->Enabled();
602 gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled); 601 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled);
603#else 602#else
604 gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, false); 603 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, false);
605#endif 604#endif
606} 605}
607 606
@@ -704,11 +703,11 @@ void send_stats()
704 std::string gpu_desc = llformat( 703 std::string gpu_desc = llformat(
705 "%-6s Class %d ", 704 "%-6s Class %d ",
706 gGLManager.mGLVendorShort.substr(0,6).c_str(), 705 gGLManager.mGLVendorShort.substr(0,6).c_str(),
707 (S32)gFeatureManagerp->getGPUClass()) 706 (S32)LLFeatureManager::getInstance()->getGPUClass())
708 + gFeatureManagerp->getGPUString(); 707 + LLFeatureManager::getInstance()->getGPUString();
709 708
710 system["gpu"] = gpu_desc; 709 system["gpu"] = gpu_desc;
711 system["gpu_class"] = (S32)gFeatureManagerp->getGPUClass(); 710 system["gpu_class"] = (S32)LLFeatureManager::getInstance()->getGPUClass();
712 system["gpu_vendor"] = gGLManager.mGLVendorShort; 711 system["gpu_vendor"] = gGLManager.mGLVendorShort;
713 system["gpu_version"] = gGLManager.mDriverVersionVendorString; 712 system["gpu_version"] = gGLManager.mDriverVersionVendorString;
714 713
@@ -754,7 +753,7 @@ void send_stats()
754 misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6 753 misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6
755 misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6 754 misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6
756 755
757 gViewerStats->addToMessage(body); 756 LLViewerStats::getInstance()->addToMessage(body);
758 757
759 LLHTTPClient::post(url, body, new ViewerStatsResponder()); 758 LLHTTPClient::post(url, body, new ViewerStatsResponder());
760} 759}