summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerstatsrecorder.h
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2010-11-19 16:49:24 -0800
committerDave SIMmONs <simon@lindenlab.com>2010-11-19 16:49:24 -0800
commit0dce88bc92cfb1ebebb575087ca950a6d5363c0c (patch)
tree849a86e71256243375f9e4dcbd214b551cc44f2a /indra/newview/llviewerstatsrecorder.h
parent2eec4949cc49f3c59cdc278be0e7eed1e092b167 (diff)
ER-330 : Improve ObjectUpdateCached message packing. Added some viewer metrics, will disable later.
Diffstat (limited to 'indra/newview/llviewerstatsrecorder.h')
-rw-r--r--indra/newview/llviewerstatsrecorder.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h
new file mode 100644
index 0000000000..0c5e6d5010
--- /dev/null
+++ b/indra/newview/llviewerstatsrecorder.h
@@ -0,0 +1,66 @@
+/**
+ * @file llviewerstatsrecorder.h
+ * @brief record info about viewer events to a metrics log file
+ *
+ * $LicenseInfo:firstyear=2010&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LLVIEWERSTATSRECORDER_H
+#define LLVIEWERSTATSRECORDER_H
+
+
+// This is a diagnostic class used to record information from the viewer
+// for analysis.
+
+// This is normally 0. Set to 1 to enable viewer stats recording
+#define LL_RECORD_VIEWER_STATS 1
+
+
+#if LL_RECORD_VIEWER_STATS
+#include "llframetimer.h"
+
+class LLViewerRegion;
+class LLViewerObject;
+
+class LLViewerStatsRecorder
+{
+ public:
+ LLViewerStatsRecorder();
+ ~LLViewerStatsRecorder();
+
+ void initStatsRecorder(LLViewerRegion *regionp);
+
+ void initCachedObjectUpdate(LLViewerRegion *regionp);
+ void recordCachedObjectEvent(LLViewerRegion *regionp, U32 local_id, LLViewerObject * objectp);
+ void closeCachedObjectUpdate(LLViewerRegion *regionp);
+
+private:
+ LLFrameTimer mTimer;
+ F64 mStartTime;
+
+ LLFILE * mObjectCacheFile; // File to write data into
+ S32 mObjectCacheHitCount;
+ S32 mObjectCacheMissCount;
+};
+#endif // LL_RECORD_VIEWER_STATS
+
+#endif // LLVIEWERSTATSRECORDER_H