summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerstats.cpp')
-rw-r--r--indra/newview/llviewerstats.cpp357
1 files changed, 227 insertions, 130 deletions
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 93919fba05..42266ad233 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -2,30 +2,25 @@
* @file llviewerstats.cpp
* @brief LLViewerStats class implementation
*
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- *
- * Copyright (c) 2002-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -35,36 +30,40 @@
#include "llviewerthrottle.h"
#include "message.h"
+#include "llfloaterreg.h"
+#include "llmemory.h"
#include "lltimer.h"
+#include "llvfile.h"
#include "llappviewer.h"
#include "pipeline.h"
+#include "lltexturefetch.h"
#include "llviewerobjectlist.h"
-#include "llviewerimagelist.h"
+#include "llviewertexturelist.h"
#include "lltexlayer.h"
+#include "lltexlayerparams.h"
#include "llsurface.h"
#include "llvlmanager.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llviewercontrol.h"
-#include "llfloaterdirectory.h"
#include "llfloatertools.h"
#include "lldebugview.h"
#include "llfasttimerview.h"
#include "llviewerregion.h"
-#include "llfloaterhtml.h"
+#include "llvoavatar.h"
+#include "llvoavatarself.h"
+#include "llviewerwindow.h" // *TODO: remove, only used for width/height
#include "llworld.h"
#include "llfeaturemanager.h"
-#if LL_WINDOWS && LL_LCD_COMPILE
- #include "lllcd.h"
-#endif
+#include "llviewernetwork.h"
-LLViewerStats *gViewerStats = NULL;
class StatAttributes
{
public:
- StatAttributes(const char *name,
+ StatAttributes(const char* name,
const BOOL enabled,
const BOOL is_timer)
: mName(name),
@@ -73,9 +72,9 @@ public:
{
}
- const char *mName;
- const BOOL mEnabled;
- const BOOL mIsTimer;
+ std::string mName;
+ BOOL mEnabled;
+ BOOL mIsTimer;
};
const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] =
@@ -195,16 +194,76 @@ const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] =
// ST_TEX_BAKES
StatAttributes("Texture Bakes", FALSE, FALSE),
// ST_TEX_REBAKES
- StatAttributes("Texture Rebakes", FALSE, FALSE),
-
- // ST_LOGITECH_KEYBOARD
- StatAttributes("Logitech LCD", FALSE, FALSE)
+ StatAttributes("Texture Rebakes", FALSE, FALSE)
};
-LLViewerStats::LLViewerStats()
- : mPacketsLostPercentStat(64),
- mLastTimeDiff(0.0)
+LLViewerStats::LLViewerStats() :
+ mKBitStat("kbitstat"),
+ mLayersKBitStat("layerskbitstat"),
+ mObjectKBitStat("objectkbitstat"),
+ mAssetKBitStat("assetkbitstat"),
+ mTextureKBitStat("texturekbitstat"),
+ mVFSPendingOperations("vfspendingoperations"),
+ mObjectsDrawnStat("objectsdrawnstat"),
+ mObjectsCulledStat("objectsculledstat"),
+ mObjectsTestedStat("objectstestedstat"),
+ mObjectsComparedStat("objectscomparedstat"),
+ mObjectsOccludedStat("objectsoccludedstat"),
+ mFPSStat("fpsstat"),
+ mPacketsInStat("packetsinstat"),
+ mPacketsLostStat("packetsloststat"),
+ mPacketsOutStat("packetsoutstat"),
+ mPacketsLostPercentStat("packetslostpercentstat", 64),
+ mTexturePacketsStat("texturepacketsstat"),
+ mActualInKBitStat("actualinkbitstat"),
+ mActualOutKBitStat("actualoutkbitstat"),
+ mTrianglesDrawnStat("trianglesdrawnstat"),
+ mSimTimeDilation("simtimedilation"),
+ mSimFPS("simfps"),
+ mSimPhysicsFPS("simphysicsfps"),
+ mSimAgentUPS("simagentups"),
+ mSimScriptEPS("simscripteps"),
+ mSimFrameMsec("simframemsec"),
+ mSimNetMsec("simnetmsec"),
+ mSimSimOtherMsec("simsimothermsec"),
+ mSimSimPhysicsMsec("simsimphysicsmsec"),
+ mSimSimPhysicsStepMsec("simsimphysicsstepmsec"),
+ mSimSimPhysicsShapeUpdateMsec("simsimphysicsshapeupdatemsec"),
+ mSimSimPhysicsOtherMsec("simsimphysicsothermsec"),
+ mSimAgentMsec("simagentmsec"),
+ mSimImagesMsec("simimagesmsec"),
+ mSimScriptMsec("simscriptmsec"),
+ mSimSpareMsec("simsparemsec"),
+ mSimSleepMsec("simsleepmsec"),
+ mSimPumpIOMsec("simpumpiomsec"),
+ mSimMainAgents("simmainagents"),
+ mSimChildAgents("simchildagents"),
+ mSimObjects("simobjects"),
+ mSimActiveObjects("simactiveobjects"),
+ mSimActiveScripts("simactivescripts"),
+ mSimInPPS("siminpps"),
+ mSimOutPPS("simoutpps"),
+ mSimPendingDownloads("simpendingdownloads"),
+ mSimPendingUploads("simpendinguploads"),
+ mSimPendingLocalUploads("simpendinglocaluploads"),
+ mSimTotalUnackedBytes("simtotalunackedbytes"),
+ mPhysicsPinnedTasks("physicspinnedtasks"),
+ mPhysicsLODTasks("physicslodtasks"),
+ mPhysicsMemoryAllocated("physicsmemoryallocated"),
+ mSimPingStat("simpingstat"),
+ mNumImagesStat("numimagesstat", 32, TRUE),
+ mNumRawImagesStat("numrawimagesstat", 32, TRUE),
+ mGLTexMemStat("gltexmemstat", 32, TRUE),
+ mGLBoundMemStat("glboundmemstat", 32, TRUE),
+ mRawMemStat("rawmemstat", 32, TRUE),
+ mFormattedMemStat("formattedmemstat", 32, TRUE),
+ mNumObjectsStat("numobjectsstat"),
+ mNumActiveObjectsStat("numactiveobjectsstat"),
+ mNumNewObjectsStat("numnewobjectsstat"),
+ mNumSizeCulledStat("numsizeculledstat"),
+ mNumVisCulledStat("numvisculledstat"),
+ mLastTimeDiff(0.0)
{
for (S32 i = 0; i < ST_COUNT; i++)
{
@@ -215,6 +274,8 @@ LLViewerStats::LLViewerStats()
{
mStats[ST_HAS_BAD_TIMER] = 1.0;
}
+
+ mAgentPositionSnaps.reset();
}
LLViewerStats::~LLViewerStats()
@@ -223,17 +284,19 @@ LLViewerStats::~LLViewerStats()
void LLViewerStats::resetStats()
{
- gViewerStats->mKBitStat.reset();
- gViewerStats->mLayersKBitStat.reset();
- gViewerStats->mObjectKBitStat.reset();
- gViewerStats->mTextureKBitStat.reset();
- gViewerStats->mVFSPendingOperations.reset();
- gViewerStats->mAssetKBitStat.reset();
- gViewerStats->mPacketsInStat.reset();
- gViewerStats->mPacketsLostStat.reset();
- gViewerStats->mPacketsOutStat.reset();
- gViewerStats->mFPSStat.reset();
- gViewerStats->mTexturePacketsStat.reset();
+ LLViewerStats::getInstance()->mKBitStat.reset();
+ LLViewerStats::getInstance()->mLayersKBitStat.reset();
+ LLViewerStats::getInstance()->mObjectKBitStat.reset();
+ LLViewerStats::getInstance()->mTextureKBitStat.reset();
+ LLViewerStats::getInstance()->mVFSPendingOperations.reset();
+ LLViewerStats::getInstance()->mAssetKBitStat.reset();
+ LLViewerStats::getInstance()->mPacketsInStat.reset();
+ LLViewerStats::getInstance()->mPacketsLostStat.reset();
+ LLViewerStats::getInstance()->mPacketsOutStat.reset();
+ LLViewerStats::getInstance()->mFPSStat.reset();
+ LLViewerStats::getInstance()->mTexturePacketsStat.reset();
+
+ LLViewerStats::getInstance()->mAgentPositionSnaps.reset();
}
@@ -328,29 +391,31 @@ void LLViewerStats::addToMessage(LLSD &body) const
<< llendl;
}
}
+
+ body["AgentPositionSnaps"] = mAgentPositionSnaps.getData();
+ llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev()
+ << "; Count = " << mAgentPositionSnaps.getCount() << llendl;
}
// static
-const char *LLViewerStats::statTypeToText(EStatType type)
-{
- if (type >= 0 && type < ST_COUNT)
- {
- return STAT_INFO[type].mName;
- }
- else
- {
- return "Unknown statistic";
- }
-}
+// 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()
{
- gPipeline.resetFrameStats(); // Reset per-frame statistics.
if (LLSurface::sTextureUpdateTime)
{
- LLSurface::sTexelsUpdatedPerSecStat.addValue(0.001f*(LLSurface::sTexelsUpdated / LLSurface::sTextureUpdateTime));
LLSurface::sTexelsUpdated = 0;
LLSurface::sTextureUpdateTime = 0.f;
}
@@ -361,9 +426,9 @@ void output_statistics(void*)
{
llinfos << "Number of orphans: " << gObjectList.getOrphanCount() << llendl;
llinfos << "Number of dead objects: " << gObjectList.mNumDeadObjects << llendl;
- llinfos << "Num images: " << gImageList.getNumImages() << llendl;
- llinfos << "Texture usage: " << LLImageGL::sGlobalTextureMemory << llendl;
- llinfos << "Texture working set: " << LLImageGL::sBoundTextureMemory << llendl;
+ llinfos << "Num images: " << gTextureList.getNumImages() << llendl;
+ llinfos << "Texture usage: " << LLImageGL::sGlobalTextureMemoryInBytes << llendl;
+ llinfos << "Texture working set: " << LLImageGL::sBoundTextureMemoryInBytes << llendl;
llinfos << "Raw usage: " << LLImageRaw::sGlobalRawMemory << llendl;
llinfos << "Formatted usage: " << LLImageFormatted::sGlobalFormattedMemory << llendl;
llinfos << "Zombie Viewer Objects: " << LLViewerObject::getNumZombieObjects() << llendl;
@@ -446,10 +511,10 @@ void output_statistics(void*)
llinfos << "--------------------------------" << llendl;
llinfos << "Avatar Memory (partly overlaps with above stats):" << llendl;
- gTexStaticImageList.dumpByteCount();
- LLVOAvatar::dumpScratchTextureByteCount();
+ LLTexLayerStaticImageList::getInstance()->dumpByteCount();
+ LLVOAvatarSelf::dumpScratchTextureByteCount();
LLTexLayerSetBuffer::dumpTotalByteCount();
- LLVOAvatar::dumpTotalLocalTextureByteCount();
+ LLVOAvatarSelf::dumpTotalLocalTextureByteCount();
LLTexLayerParamAlpha::dumpCacheByteCount();
LLVOAvatar::dumpBakedStatus();
@@ -499,82 +564,82 @@ extern U32 gVisCompared;
extern U32 gVisTested;
std::map<S32,LLFrameTimer> gDebugTimers;
+std::map<S32,std::string> gDebugTimerLabel;
+
+void init_statistics()
+{
+ // Label debug timers
+ gDebugTimerLabel[0] = "Texture";
+}
void update_statistics(U32 frame_count)
{
gTotalWorldBytes += gVLManager.getTotalBytes();
gTotalObjectBytes += gObjectBits / 8;
- gTotalTextureBytes += LLViewerImageList::sTextureBits / 8;
// make sure we have a valid time delta for this frame
if (gFrameIntervalSeconds > 0.f)
{
- if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK)
+ if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK)
{
- gViewerStats->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds);
+ LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds);
}
- else if (gAgent.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR)
+ else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR)
{
- gViewerStats->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds);
+ LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds);
}
- else if (gFloaterTools && gFloaterTools->getVisible())
+ else if (LLFloaterReg::instanceVisible("build"))
{
- gViewerStats->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds);
+ LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds);
}
}
- gViewerStats->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
- gViewerStats->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail"));
- gViewerStats->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
- gViewerStats->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles"));
+ 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"));
#if 0 // 1.9.2
- gViewerStats->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject"));
- gViewerStats->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar"));
- gViewerStats->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment"));
+ 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"));
#endif
- gViewerStats->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME));
- F64 idle_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IDLE);
- F64 network_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_NETWORK);
- gViewerStats->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs);
- gViewerStats->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs);
- gViewerStats->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IMAGE_UPDATE));
- gViewerStats->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_STATESORT ));
- gViewerStats->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_RENDER_GEOMETRY));
+ LLViewerStats::getInstance()->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"));
LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost());
if (cdp)
{
- gViewerStats->mSimPingStat.addValue(cdp->getPingDelay());
+ LLViewerStats::getInstance()->mSimPingStat.addValue(cdp->getPingDelay());
gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1);
gSimPingCount++;
}
else
{
- gViewerStats->mSimPingStat.addValue(10000);
+ LLViewerStats::getInstance()->mSimPingStat.addValue(10000);
}
- gViewerStats->mFPSStat.addValue(1);
+ LLViewerStats::getInstance()->mFPSStat.addValue(1);
F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
- gViewerStats->mLayersKBitStat.addValue(layer_bits/1024.f);
- gViewerStats->mObjectKBitStat.addValue(gObjectBits/1024.f);
- gViewerStats->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f);
- gViewerStats->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
- gViewerStats->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
+ 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);
gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
- static S32 tex_bits_idle_count = 0;
- if (LLViewerImageList::sTextureBits == 0)
+ if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
{
- if (++tex_bits_idle_count >= 30)
- gDebugTimers[0].pause();
+ gDebugTimers[0].pause();
}
else
{
- tex_bits_idle_count = 0;
gDebugTimers[0].unpause();
}
- gViewerStats->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets);
-
{
static F32 visible_avatar_frames = 0.f;
static F32 avg_visible_avatars = 0;
@@ -584,25 +649,31 @@ 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;
}
- gViewerStats->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars);
+ LLViewerStats::getInstance()->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars);
}
- gWorldp->updateNetStats();
- gWorldp->requestCacheMisses();
+ LLWorld::getInstance()->updateNetStats();
+ LLWorld::getInstance()->requestCacheMisses();
// Reset all of these values.
gVLManager.resetBitCounts();
gObjectBits = 0;
// gDecodedBits = 0;
- LLViewerImageList::sTextureBits = 0;
- LLViewerImageList::sTexturePackets = 0;
+ // Only update texture stats periodically so that they are less noisy
+ {
+ static const F32 texture_stats_freq = 10.f;
+ 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);
+ gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8;
+ LLViewerTextureList::sTextureBits = 0;
+ LLViewerTextureList::sTexturePackets = 0;
+ texture_stats_timer.reset();
+ }
+ }
-#if LL_WINDOWS && LL_LCD_COMPILE
- bool LCDenabled = gLcdScreen->Enabled();
- gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled);
-#else
- gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, false);
-#endif
}
class ViewerStatsResponder : public LLHTTPClient::Responder
@@ -660,7 +731,7 @@ void send_stats()
time(&ltime);
F32 run_time = F32(LLFrameTimer::getElapsedSeconds());
- agent["start_time"] = ltime - run_time;
+ agent["start_time"] = S32(ltime - S32(run_time));
// The first stat set must have a 0 run time if it doesn't actually
// contain useful data in terms of FPS, etc. We use half the
@@ -679,8 +750,7 @@ void send_stats()
// send fps only for time app spends in foreground
agent["fps"] = (F32)gForegroundFrameCount / gForegroundTime.getElapsedTimeF32();
agent["version"] = gCurrentVersion;
- LLString language(gSavedSettings.getString("Language"));
- if(language == "default") language = gSavedSettings.getString("SystemLanguage");
+ std::string language = LLUI::getLanguage();
agent["language"] = language;
agent["sim_fps"] = ((F32) gFrameCount - gSimFrames) /
@@ -693,22 +763,28 @@ void send_stats()
agent["ping"] = gAvgSimPing;
agent["meters_traveled"] = gAgent.getDistanceTraveled();
agent["regions_visited"] = gAgent.getRegionsVisited();
- agent["mem_use"] = getCurrentRSS() / 1024.0;
+ agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0;
LLSD &system = body["system"];
system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB();
system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
system["cpu"] = gSysCPU.getCPUString();
-
+ unsigned char MACAddress[MAC_ADDRESS_BYTES];
+ LLUUID::getNodeID(MACAddress);
+ std::string macAddressString = llformat("%02x-%02x-%02x-%02x-%02x-%02x",
+ MACAddress[0],MACAddress[1],MACAddress[2],
+ MACAddress[3],MACAddress[4],MACAddress[5]);
+ system["mac_address"] = macAddressString;
+ system["serial_number"] = LLAppViewer::instance()->getSerialNumber();
std::string gpu_desc = llformat(
"%-6s Class %d ",
gGLManager.mGLVendorShort.substr(0,6).c_str(),
- (S32)gFeatureManagerp->getGPUClass())
- + gFeatureManagerp->getGPUString();
+ (S32)LLFeatureManager::getInstance()->getGPUClass())
+ + LLFeatureManager::getInstance()->getGPUString();
system["gpu"] = gpu_desc;
- system["gpu_class"] = (S32)gFeatureManagerp->getGPUClass();
+ system["gpu_class"] = (S32)LLFeatureManager::getInstance()->getGPUClass();
system["gpu_vendor"] = gGLManager.mGLVendorShort;
system["gpu_version"] = gGLManager.mDriverVersionVendorString;
@@ -749,12 +825,33 @@ void send_stats()
// If the current revision is recent, ping the previous author before overriding
LLSD &misc = body["stats"]["misc"];
- // misc["string_1"] =
- // misc["string_2"] =
- misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6
- misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6
-
- gViewerStats->addToMessage(body);
+ // Screen size so the UI team can figure out how big the widgets
+ // appear and use a "typical" size for end user tests.
+ S32 window_width = gViewerWindow->getWindowWidthRaw();
+ S32 window_height = gViewerWindow->getWindowHeightRaw();
+ S32 window_size = (window_width * window_height) / 1024;
+ misc["string_1"] = llformat("%d", window_size);
+ if (gDebugTimers.find(0) != gDebugTimers.end() && gFrameTimeSeconds > 0)
+ {
+ misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gDebugTimers[0].getElapsedTimeF32(), gFrameTimeSeconds);
+ }
+
+// misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21
+// misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21
+
+ F32 unbaked_time = LLVOAvatar::sUnbakedTime * 1000.f / gFrameTimeSeconds;
+ misc["int_1"] = LLSD::Integer(unbaked_time); // Steve: 1.22
+ F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds;
+ misc["int_2"] = LLSD::Integer(grey_time); // Steve: 1.22
+
+ llinfos << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << llendl;
+ llinfos << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << llendl;
+
+ body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames");
+ body["DisplayNamesShowUsername"] = gSavedSettings.getBOOL("NameTagShowUsernames");
+
+ LLViewerStats::getInstance()->addToMessage(body);
LLHTTPClient::post(url, body, new ViewerStatsResponder());
}
+