llviewerstats.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLVIEWERSTATS_H
00033 #define LL_LLVIEWERSTATS_H
00034 
00035 #include "llstat.h"
00036 
00037 class LLViewerStats : public LLSingleton<LLViewerStats>
00038 {
00039 public:
00040         LLStat mKBitStat;
00041         LLStat mLayersKBitStat;
00042         LLStat mObjectKBitStat;
00043         LLStat mAssetKBitStat;
00044         LLStat mTextureKBitStat;
00045         LLStat mVFSPendingOperations;
00046         LLStat mObjectsDrawnStat;
00047         LLStat mObjectsCulledStat;
00048         LLStat mObjectsTestedStat;
00049         LLStat mObjectsComparedStat;
00050         LLStat mObjectsOccludedStat;
00051         LLStat mFPSStat;
00052         LLStat mPacketsInStat;
00053         LLStat mPacketsLostStat;
00054         LLStat mPacketsOutStat;
00055         LLStat mPacketsLostPercentStat;
00056         LLStat mTexturePacketsStat;
00057         LLStat mActualInKBitStat;       // From the packet ring (when faking a bad connection)
00058         LLStat mActualOutKBitStat;      // From the packet ring (when faking a bad connection)
00059 
00060         // Simulator stats
00061         LLStat mSimTimeDilation;
00062 
00063         LLStat mSimFPS;
00064         LLStat mSimPhysicsFPS;
00065         LLStat mSimAgentUPS;
00066         LLStat mSimLSLIPS;
00067 
00068         LLStat mSimFrameMsec;
00069         LLStat mSimNetMsec;
00070         LLStat mSimSimOtherMsec;
00071         LLStat mSimSimPhysicsMsec;
00072 
00073         LLStat mSimSimPhysicsStepMsec;
00074         LLStat mSimSimPhysicsShapeUpdateMsec;
00075         LLStat mSimSimPhysicsOtherMsec;
00076 
00077         LLStat mSimAgentMsec;
00078         LLStat mSimImagesMsec;
00079         LLStat mSimScriptMsec;
00080 
00081         LLStat mSimMainAgents;
00082         LLStat mSimChildAgents;
00083         LLStat mSimObjects;
00084         LLStat mSimActiveObjects;
00085         LLStat mSimActiveScripts;
00086 
00087         LLStat mSimInPPS;
00088         LLStat mSimOutPPS;
00089         LLStat mSimPendingDownloads;
00090         LLStat mSimPendingUploads;
00091         LLStat mSimPendingLocalUploads;
00092         LLStat mSimTotalUnackedBytes;
00093 
00094         LLStat mPhysicsPinnedTasks;
00095         LLStat mPhysicsLODTasks;
00096         LLStat mPhysicsMemoryAllocated;
00097         /*
00098         LLStat mSimCPUUsageStat;
00099         LLStat mSimMemTotalStat;
00100         LLStat mSimMemRSSStat;
00101         */
00102 
00103 
00104         LLStat mSimPingStat;
00105 
00106         void resetStats();
00107 public:
00108         // If you change this, please also add a corresponding text label
00109         // in statTypeToText in llviewerstats.cpp
00110         enum EStatType
00111         {
00112                 ST_VERSION = 0,
00113                 ST_AVATAR_EDIT_SECONDS = 1,
00114                 ST_TOOLBOX_SECONDS = 2,
00115                 ST_CHAT_COUNT = 3,
00116                 ST_IM_COUNT = 4,
00117                 ST_FULLSCREEN_BOOL = 5,
00118                 ST_RELEASE_COUNT= 6,
00119                 ST_CREATE_COUNT = 7,
00120                 ST_REZ_COUNT = 8,
00121                 ST_FPS_10_SECONDS = 9,
00122                 ST_FPS_2_SECONDS = 10,
00123                 ST_MOUSELOOK_SECONDS = 11,
00124                 ST_FLY_COUNT = 12,
00125                 ST_TELEPORT_COUNT = 13,
00126                 ST_OBJECT_DELETE_COUNT = 14,
00127                 ST_SNAPSHOT_COUNT = 15,
00128                 ST_UPLOAD_SOUND_COUNT = 16,
00129                 ST_UPLOAD_TEXTURE_COUNT = 17,
00130                 ST_EDIT_TEXTURE_COUNT = 18,
00131                 ST_KILLED_COUNT = 19,
00132                 ST_FRAMETIME_JITTER = 20,
00133                 ST_FRAMETIME_SLEW = 21,
00134                 ST_INVENTORY_TOO_LONG = 22,
00135                 ST_WEARABLES_TOO_LONG = 23,
00136                 ST_LOGIN_SECONDS = 24,
00137                 ST_LOGIN_TIMEOUT_COUNT = 25,
00138                 ST_HAS_BAD_TIMER = 26,
00139                 ST_DOWNLOAD_FAILED = 27,
00140                 ST_LSL_SAVE_COUNT = 28,
00141                 ST_UPLOAD_ANIM_COUNT = 29,
00142                 ST_FPS_8_SECONDS = 30,
00143                 ST_SIM_FPS_20_SECONDS = 31,
00144                 ST_PHYS_FPS_20_SECONDS = 32,
00145                 ST_LOSS_05_SECONDS = 33,
00146                 ST_FPS_DROP_50_RATIO = 34,
00147                 ST_ENABLE_VBO = 35,
00148                 ST_DELTA_BANDWIDTH = 36,
00149                 ST_MAX_BANDWIDTH = 37,
00150                 ST_LIGHTING_DETAIL = 38,
00151                 ST_VISIBLE_AVATARS = 39,
00152                 ST_SHADER_OBJECTS = 40,
00153                 ST_SHADER_ENVIRONMENT = 41,
00154                 ST_DRAW_DIST = 42,
00155                 ST_CHAT_BUBBLES = 43,
00156                 ST_SHADER_AVATAR = 44,
00157                 ST_FRAME_SECS = 45,
00158                 ST_UPDATE_SECS = 46,
00159                 ST_NETWORK_SECS = 47,
00160                 ST_IMAGE_SECS = 48,
00161                 ST_REBUILD_SECS = 49,
00162                 ST_RENDER_SECS = 50,
00163                 ST_CROSSING_AVG = 51,
00164                 ST_CROSSING_MAX = 52,
00165                 ST_LIBXUL_WIDGET_USED = 53, // Unused
00166                 ST_WINDOW_WIDTH = 54,
00167                 ST_WINDOW_HEIGHT = 55,
00168                 ST_TEX_BAKES = 56,
00169                 ST_TEX_REBAKES = 57,
00170                 ST_LOGITECH_LCD = 58,
00171                 
00172                 ST_COUNT = 59
00173         };
00174 
00175 
00176         LLViewerStats();
00177         ~LLViewerStats();
00178 
00179         // all return latest value of given stat
00180         F64 getStat(EStatType type) const;
00181         F64 setStat(EStatType type, F64 value);         // set the stat to value
00182         F64 incStat(EStatType type, F64 value = 1.f);   // add value to the stat
00183 
00184         void updateFrameStats(const F64 time_diff);
00185         
00186         void addToMessage(LLSD &body) const;
00187 
00188         static const char *statTypeToText(EStatType type);
00189 
00190 private:
00191         F64     mStats[ST_COUNT];
00192 
00193         F64 mLastTimeDiff;  // used for time stat updates
00194 };
00195 
00196 static const F32 SEND_STATS_PERIOD = 300.0f;
00197 
00198 // The following are from (older?) statistics code found in appviewer.
00199 void reset_statistics();
00200 void output_statistics(void*);
00201 void update_statistics(U32 frame_count);
00202 void send_stats();
00203 
00204 extern std::map<S32,LLFrameTimer> gDebugTimers;
00205 #endif // LL_LLVIEWERSTATS_H

Generated on Fri May 16 08:34:17 2008 for SecondLife by  doxygen 1.5.5