summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-10-03 19:32:59 -0700
committerRichard Linden <none@none>2012-10-03 19:32:59 -0700
commit8f5e83789254d19a1a31737b0d7515cd7e967b26 (patch)
treee010acddfb59491fe805371b91167e679b8fa598 /indra/newview
parent7196619b4a0823a332e10b7f98464a1649e0dfd2 (diff)
SH-3405 WIP convert existing stats to lltrace system
SH-3403 FIX implement unit conversion LLUnit implements unit tracking and conversion added support for LLUnit to LLTrace duplicated most llstats into LLTrace equivalents
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llstatusbar.cpp2
-rwxr-xr-xindra/newview/llviewerstats.cpp131
-rwxr-xr-xindra/newview/llviewerstats.h120
-rw-r--r--indra/newview/llviewertexturelist.cpp2
-rw-r--r--indra/newview/llworld.cpp3
5 files changed, 238 insertions, 20 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index ab97d6465a..6f2a0de894 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -198,7 +198,7 @@ BOOL LLStatusBar::postBuild()
sgp.rect(r);
sgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
sgp.mouse_opaque(false);
- sgp.stat.rate_stat(&STAT_KBIT);
+ sgp.stat.rate_stat(&LLStatViewer::KBIT);
sgp.units("Kbps");
sgp.precision(0);
mSGBandwidth = LLUICtrlFactory::create<LLStatGraph>(sgp);
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index a6e9643edd..954fa24eaa 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -61,21 +61,128 @@
#include "llviewernetwork.h"
#include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived
+namespace LLStatViewer
+{
-LLTrace::Rate<F32> STAT_KBIT("kbitstat"),
- STAT_LAYERS_KBIT("layerskbitstat"),
- STAT_OBJECT_KBIT("objectkbitstat"),
- STAT_ASSET_KBIT("assetkbitstat"),
- STAT_TEXTURE_KBIT("texturekbitstat");
-
+LLTrace::Rate<F32> FPS("fpsstat"),
+ PACKETS_IN("packetsinstat"),
+ PACKETS_LOST("packetsloststat"),
+ PACKETS_OUT("packetsoutstat"),
+ TEXTURE_PACKETS("texturepacketsstat"),
+ TRIANGLES_DRAWN("trianglesdrawnstat"),
+ CHAT_COUNT("chatcount"),
+ IM_COUNT("imcount"),
+ OBJECT_CREATE("objectcreate"),
+ OBJECT_REZ("objectrez"),
+ LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay"),
+ LOGIN_TIMEOUTS("logintimeouts"),
+ FAILED_DOWNLOADS("faileddownloads"),
+ LSL_SAVES("lslsaves"),
+ ANIMATION_UPLOADS("animationuploads"),
+ FLY("fly"),
+ TELEPORT("teleport"),
+ DELETE_OBJECT("deleteobject"),
+ SNAPSHOT("snapshot"),
+ UPLOAD_SOUND("uploadsound"),
+ UPLOAD_TEXTURE("uploadtexture"),
+ EDIT_TEXTURE("edittexture"),
+ KILLED("killed"),
+ FRAMETIME_DOUBLED("frametimedoubled"),
+ TEX_BAKES("texbakes"),
+ TEX_REBAKES("texrebakes");
+LLTrace::Rate<LLUnits::Bytes<F32> > KBIT("kbitstat"),
+ LAYERS_KBIT("layerskbitstat"),
+ OBJECT_KBIT("objectkbitstat"),
+ ASSET_KBIT("assetkbitstat"),
+ TEXTURE_KBIT("texturekbitstat"),
+ ACTUAL_IN_KBIT("actualinkbit"),
+ ACTUAL_OUT_KBIT("actualoutkbit");
+
+LLTrace::Rate<LLUnits::Seconds<F32> > AVATAR_EDIT_TIME("avataredittimr"),
+ TOOLBOX_TIME("toolboxtime"),
+ MOUSELOOK_TIME("mouselooktime"),
+ FPS_10_TIME("fps10time"),
+ FPS_8_TIME("fps8time"),
+ FPS_2_TIME("fps2time"),
+ SIM_20_FPS_TIME("sim20fpstime"),
+ SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime"),
+ LOSS_5_PERCENT_TIME("loss5percenttime");
+
+LLTrace::Measurement<F32> SIM_TIME_DILATION("simtimedilation"),
+ SIM_FPS("simfps"),
+ SIM_PHYSICS_FPS("simphysicsfps"),
+ SIM_AGENT_UPS("simagentups"),
+ SIM_SCRIPT_EPS("simscripteps"),
+ SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps"),
+ SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters"),
+ SIM_MAIN_AGENTS("simmainagents"),
+ SIM_CHILD_AGENTS("simchildagents"),
+ SIM_OBJECTS("simobjects"),
+ SIM_ACTIVE_OBJECTS("simactiveobjects"),
+ SIM_ACTIVE_SCRIPTS("simactivescripts"),
+ SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun"),
+ SIM_IN_PACKETS_PER_SEC("siminpps"),
+ SIM_OUT_PACKETS_PER_SEC("simoutpps"),
+ SIM_PENDING_DOWNLOADS("simpendingdownloads"),
+ SIM_PENDING_UPLOADS("simpendinguploads"),
+ SIM_PENING_LOCAL_UPLOADS("simpendinglocaluploads"),
+ SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks"),
+ SIM_PHYSICS_LOD_TASKS("physicslodtasks"),
+ NUM_IMAGES("numimagesstat"),
+ NUM_RAW_IMAGES("numrawimagesstat"),
+ NUM_OBJECTS("numobjectsstat"),
+ NUM_ACTIVE_OBJECTS("numactiveobjectsstat"),
+ NUM_NEW_OBJECTS("numnewobjectsstat"),
+ NUM_SIZE_CULLED("numsizeculledstat"),
+ NUM_VIS_CULLED("numvisculledstat"),
+ ENABLE_VBO("enablevbo"),
+ DELTA_BANDWIDTH("deltabandwidth"),
+ MAX_BANDWIDTH("maxbandwidth"),
+ LIGHTING_DETAIL("lightingdetail"),
+ VISIBLE_AVATARS("visibleavatars"),
+ SHADER_OBJECTS("shaderobjects"),
+ DRAW_DISTANCE("drawdistance"),
+ CHAT_BUBBLES("chatbubbles"),
+ WINDOW_WIDTH("windowwidth"),
+ WINDOW_HEIGHT("windowheight");
+
+LLTrace::Measurement<LLUnits::Bytes<F32> > SIM_UNACKED_BYTES("simtotalunackedbytes"),
+ SIM_PHYSICS_MEM("physicsmemoryallocated"),
+ GL_TEX_MEM("gltexmemstat"),
+ GL_BOUND_MEM("glboundmemstat"),
+ RAW_MEM("rawmemstat"),
+ FORMATTED_MEM("formattedmemstat");
+
+
+LLTrace::Measurement<LLUnits::Seconds<F32> > SIM_PHYSICS_TIME("simsimphysicsmsec"),
+ SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec"),
+ SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec"),
+ SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec"),
+ SIM_AI_TIME("simsimaistepmsec"),
+ SIM_AGENTS_TIME("simagentmsec"),
+ SIM_IMAGES_TIME("simimagesmsec"),
+ SIM_SCRIPTS_TIME("simscriptmsec"),
+ SIM_SPARE_TIME("simsparemsec"),
+ SIM_SLEEP_TIME("simsleepmsec"),
+ SIM_PUMP_IO_TIME("simpumpiomsec"),
+ SIM_PING("simpingstat"),
+ LOGIN_SECONDS("loginseconds"),
+ REGION_CROSSING_TIME("regioncrossingtime"),
+ FRAME_STACKTIME("framestacktime"),
+ UPDATE_STACKTIME("updatestacktime"),
+ NETWORK_STACKTIME("networkstacktime"),
+ IMAGE_STACKTIME("imagestacktime"),
+ REBUILD_STACKTIME("rebuildstacktime"),
+ RENDER_STACKTIME("renderstacktime");
+}
class StatAttributes
{
public:
StatAttributes(const char* name,
const BOOL enabled)
- : mName(name),
- mEnabled(enabled)
+ : mName(name),
+ mEnabled(enabled)
{
}
@@ -465,12 +572,12 @@ void update_statistics()
stats.mFPSStat.addValue(1);
F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
- STAT_LAYERS_KBIT.add(layer_bits/1024.f);
+ LLStatViewer::LAYERS_KBIT.add<LLUnits::Bits<F32> >(layer_bits);
//stats.mLayersKBitStat.addValue(layer_bits/1024.f);
- STAT_OBJECT_KBIT.add(gObjectBits/1024.f);
+ LLStatViewer::OBJECT_KBIT.add<LLUnits::Bits<F32> >(gObjectBits);
//stats.mObjectKBitStat.addValue(gObjectBits/1024.f);
stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
- STAT_ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
+ LLStatViewer::ASSET_KBIT.add<LLUnits::Bits<F32> >(gTransferManager.getTransferBitsIn(LLTCT_ASSET));
//stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
@@ -508,7 +615,7 @@ void update_statistics()
static LLFrameTimer texture_stats_timer;
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
{
- STAT_TEXTURE_KBIT.add(LLViewerTextureList::sTextureBits/1024.f);
+ LLStatViewer::TEXTURE_KBIT.add<LLUnits::Bits<F32> >(LLViewerTextureList::sTextureBits);
//stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f);
stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets);
gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8;
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index ca5f6c6821..af2e915994 100755
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -32,11 +32,121 @@
#include "lltracerecording.h"
#include "lltrace.h"
-extern LLTrace::Rate<F32> STAT_KBIT,
- STAT_LAYERS_KBIT,
- STAT_OBJECT_KBIT,
- STAT_ASSET_KBIT,
- STAT_TEXTURE_KBIT;
+namespace LLStatViewer
+{
+extern LLTrace::Rate<F32> FPS,
+ PACKETS_IN,
+ PACKETS_LOST,
+ PACKETS_OUT,
+ TEXTURE_PACKETS,
+ TRIANGLES_DRAWN,
+ CHAT_COUNT,
+ IM_COUNT,
+ OBJECT_CREATE,
+ OBJECT_REZ,
+ LOADING_WEARABLES_LONG_DELAY,
+ LOGIN_TIMEOUTS,
+ FAILED_DOWNLOADS,
+ LSL_SAVES,
+ ANIMATION_UPLOADS,
+ FLY,
+ TELEPORT,
+ DELETE_OBJECT,
+ SNAPSHOT,
+ UPLOAD_SOUND,
+ UPLOAD_TEXTURE,
+ EDIT_TEXTURE,
+ KILLED,
+ FRAMETIME_DOUBLED,
+ TEX_BAKES,
+ TEX_REBAKES;
+
+
+extern LLTrace::Rate<LLUnits::Bytes<F32> > KBIT,
+ LAYERS_KBIT,
+ OBJECT_KBIT,
+ ASSET_KBIT,
+ TEXTURE_KBIT,
+ ACTUAL_IN_KBIT,
+ ACTUAL_OUT_KBIT;
+
+extern LLTrace::Rate<LLUnits::Seconds<F32> > AVATAR_EDIT_TIME,
+ TOOLBOX_TIME,
+ MOUSELOOK_TIME,
+ FPS_10_TIME,
+ FPS_8_TIME,
+ FPS_2_TIME,
+ SIM_20_FPS_TIME,
+ SIM_PHYSICS_20_FPS_TIME,
+ LOSS_5_PERCENT_TIME;
+
+extern LLTrace::Measurement<F32> SIM_TIME_DILATION,
+ SIM_FPS,
+ SIM_PHYSICS_FPS,
+ SIM_AGENT_UPS,
+ SIM_SCRIPT_EPS,
+ SIM_SKIPPED_SILHOUETTE,
+ SIM_SKIPPED_CHARACTERS_PERCENTAGE,
+ SIM_MAIN_AGENTS,
+ SIM_CHILD_AGENTS,
+ SIM_OBJECTS,
+ SIM_ACTIVE_OBJECTS,
+ SIM_ACTIVE_SCRIPTS,
+ SIM_PERCENTAGE_SCRIPTS_RUN,
+ SIM_IN_PACKETS_PER_SEC,
+ SIM_OUT_PACKETS_PER_SEC,
+ SIM_PENDING_DOWNLOADS,
+ SIM_PENDING_UPLOADS,
+ SIM_PENING_LOCAL_UPLOADS,
+ SIM_PHYSICS_PINNED_TASKS,
+ SIM_PHYSICS_LOD_TASKS,
+ NUM_IMAGES,
+ NUM_RAW_IMAGES,
+ NUM_OBJECTS,
+ NUM_ACTIVE_OBJECTS,
+ NUM_NEW_OBJECTS,
+ NUM_SIZE_CULLED,
+ NUM_VIS_CULLED,
+ ENABLE_VBO,
+ DELTA_BANDWIDTH,
+ MAX_BANDWIDTH,
+ LIGHTING_DETAIL,
+ VISIBLE_AVATARS,
+ SHADER_OBJECTS,
+ DRAW_DISTANCE,
+ CHAT_BUBBLES,
+ WINDOW_WIDTH,
+ WINDOW_HEIGHT;
+
+extern LLTrace::Measurement<LLUnits::Bytes<F32> > SIM_UNACKED_BYTES,
+ SIM_PHYSICS_MEM,
+ GL_TEX_MEM,
+ GL_BOUND_MEM,
+ RAW_MEM,
+ FORMATTED_MEM;
+
+
+extern LLTrace::Measurement<LLUnits::Seconds<F32> > SIM_PHYSICS_TIME,
+ SIM_PHYSICS_STEP_TIME,
+ SIM_PHYSICS_SHAPE_UPDATE_TIME,
+ SIM_PHYSICS_OTHER_TIME,
+ SIM_AI_TIME,
+ SIM_AGENTS_TIME,
+ SIM_IMAGES_TIME,
+ SIM_SCRIPTS_TIME,
+ SIM_SPARE_TIME,
+ SIM_SLEEP_TIME,
+ SIM_PUMP_IO_TIME,
+ SIM_PING,
+ LOGIN_SECONDS,
+ REGION_CROSSING_TIME,
+ FRAME_STACKTIME,
+ UPDATE_STACKTIME,
+ NETWORK_STACKTIME,
+ IMAGE_STACKTIME,
+ REBUILD_STACKTIME,
+ RENDER_STACKTIME;
+}
class LLViewerStats : public LLSingleton<LLViewerStats>
{
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 4e62cbd714..de3dd3c1c6 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -624,7 +624,7 @@ void LLViewerTextureList::updateImages(F32 max_time)
LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording();
- LLAppViewer::getTextureFetch()->setTextureBandwidth(recording->getPerSec(STAT_TEXTURE_KBIT));
+ LLAppViewer::getTextureFetch()->setTextureBandwidth(recording->getPerSec(LLStatViewer::TEXTURE_KBIT));
LLViewerStats::getInstance()->mNumImagesStat.addValue(sNumImages);
LLViewerStats::getInstance()->mNumRawImagesStat.addValue(LLImageRaw::sRawImageCount);
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 1e8665e229..bf2a58f107 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -702,9 +702,10 @@ void LLWorld::updateNetStats()
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);
- STAT_KBIT.add(bits/1024.f);
+ LLStatViewer::KBIT.add<LLUnits::Bits<F32> >(bits);
//LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f);
LLViewerStats::getInstance()->mPacketsInStat.addValue(packets_in);
LLViewerStats::getInstance()->mPacketsOutStat.addValue(packets_out);