00001
00032 #ifndef LL_LLVIEWERSTATS_H
00033 #define LL_LLVIEWERSTATS_H
00034
00035 #include "llstat.h"
00036
00037 class 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;
00058 LLStat mActualOutKBitStat;
00059
00060
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 LLStat mSimAgentMsec;
00073 LLStat mSimImagesMsec;
00074 LLStat mSimScriptMsec;
00075
00076 LLStat mSimMainAgents;
00077 LLStat mSimChildAgents;
00078 LLStat mSimObjects;
00079 LLStat mSimActiveObjects;
00080 LLStat mSimActiveScripts;
00081
00082 LLStat mSimInPPS;
00083 LLStat mSimOutPPS;
00084 LLStat mSimPendingDownloads;
00085 LLStat mSimPendingUploads;
00086 LLStat mSimPendingLocalUploads;
00087 LLStat mSimTotalUnackedBytes;
00088
00089
00090
00091
00092
00093
00094
00095
00096 LLStat mSimPingStat;
00097 LLStat mUserserverPingStat;
00098
00099 void resetStats();
00100 public:
00101
00102
00103 enum EStatType
00104 {
00105 ST_VERSION = 0,
00106 ST_AVATAR_EDIT_SECONDS = 1,
00107 ST_TOOLBOX_SECONDS = 2,
00108 ST_CHAT_COUNT = 3,
00109 ST_IM_COUNT = 4,
00110 ST_FULLSCREEN_BOOL = 5,
00111 ST_RELEASE_COUNT= 6,
00112 ST_CREATE_COUNT = 7,
00113 ST_REZ_COUNT = 8,
00114 ST_FPS_10_SECONDS = 9,
00115 ST_FPS_2_SECONDS = 10,
00116 ST_MOUSELOOK_SECONDS = 11,
00117 ST_FLY_COUNT = 12,
00118 ST_TELEPORT_COUNT = 13,
00119 ST_OBJECT_DELETE_COUNT = 14,
00120 ST_SNAPSHOT_COUNT = 15,
00121 ST_UPLOAD_SOUND_COUNT = 16,
00122 ST_UPLOAD_TEXTURE_COUNT = 17,
00123 ST_EDIT_TEXTURE_COUNT = 18,
00124 ST_KILLED_COUNT = 19,
00125 ST_FRAMETIME_JITTER = 20,
00126 ST_FRAMETIME_SLEW = 21,
00127 ST_INVENTORY_TOO_LONG = 22,
00128 ST_WEARABLES_TOO_LONG = 23,
00129 ST_LOGIN_SECONDS = 24,
00130 ST_LOGIN_TIMEOUT_COUNT = 25,
00131 ST_HAS_BAD_TIMER = 26,
00132 ST_DOWNLOAD_FAILED = 27,
00133 ST_LSL_SAVE_COUNT = 28,
00134 ST_UPLOAD_ANIM_COUNT = 29,
00135 ST_FPS_8_SECONDS = 30,
00136 ST_SIM_FPS_20_SECONDS = 31,
00137 ST_PHYS_FPS_20_SECONDS = 32,
00138 ST_LOSS_05_SECONDS = 33,
00139 ST_FPS_DROP_50_RATIO = 34,
00140 ST_ENABLE_VBO = 35,
00141 ST_DELTA_BANDWIDTH = 36,
00142 ST_MAX_BANDWIDTH = 37,
00143 ST_LIGHTING_DETAIL = 38,
00144 ST_VISIBLE_AVATARS = 39,
00145 ST_SHADER_OBJECTS = 40,
00146 ST_SHADER_ENVIRONMENT = 41,
00147 ST_DRAW_DIST = 42,
00148 ST_CHAT_BUBBLES = 43,
00149 ST_SHADER_AVATAR = 44,
00150 ST_FRAME_SECS = 45,
00151 ST_UPDATE_SECS = 46,
00152 ST_NETWORK_SECS = 47,
00153 ST_IMAGE_SECS = 48,
00154 ST_REBUILD_SECS = 49,
00155 ST_RENDER_SECS = 50,
00156 ST_CROSSING_AVG = 51,
00157 ST_CROSSING_MAX = 52,
00158 ST_LIBXUL_WIDGET_USED = 53,
00159 ST_WINDOW_WIDTH = 54,
00160 ST_WINDOW_HEIGHT = 55,
00161 ST_TEX_BAKES = 56,
00162 ST_TEX_REBAKES = 57,
00163 ST_LOGITECH_LCD = 58,
00164
00165 ST_COUNT = 59
00166 };
00167
00168
00169 LLViewerStats();
00170 ~LLViewerStats();
00171
00172
00173 F64 getStat(EStatType type) const;
00174 F64 setStat(EStatType type, F64 value);
00175 F64 incStat(EStatType type, F64 value = 1.f);
00176
00177 void updateFrameStats(const F64 time_diff);
00178
00179 void addToMessage(LLSD &body) const;
00180
00181 static const char *statTypeToText(EStatType type);
00182
00183 private:
00184 F64 mStats[ST_COUNT];
00185
00186 F64 mLastTimeDiff;
00187 };
00188
00189 extern LLViewerStats *gViewerStats;
00190
00191 #endif // LL_LLVIEWERSTATS_H