summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerassetstats.h
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2010-11-18 08:43:09 -0800
committerMonty Brandenberg <monty@lindenlab.com>2010-11-18 08:43:09 -0800
commitd666a3d92cb5dd9844c29e5472db542de7b5ac9e (patch)
treeccb120ccbaf4d9dc61267e4ab3177ad6b920dabb /indra/newview/llviewerassetstats.h
parentdeeef0c73ead965f7202bb5ac4c8481354f3b08e (diff)
ESC-154 ESC-155 ESC-156
Asset fetch requests wrapped to allow for measurements. Asset fetch enqueues, dequeues and completion times recorded to asset stats collector. Texture fetch operations (http and udp) recorded to asset stats collector. Stats collector time vallue switched from F32 to U64 which is the more common type in the viewer. Cross-thread mechanism introduced to communicate region changes and generate global statistics messages. Facility to deliver metrics via Capabilities sketched in but needs additional work. Documentation and diagrams added.
Diffstat (limited to 'indra/newview/llviewerassetstats.h')
-rw-r--r--indra/newview/llviewerassetstats.h48
1 files changed, 42 insertions, 6 deletions
diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h
index b8356a5ff5..efd0897bb8 100644
--- a/indra/newview/llviewerassetstats.h
+++ b/indra/newview/llviewerassetstats.h
@@ -96,6 +96,13 @@ public:
};
/**
+ * Type for duration and other time values in the metrics. Selected
+ * for compatibility with the pre-existing timestamp on the texture
+ * fetcher class, LLTextureFetch.
+ */
+ typedef U64 duration_t;
+
+ /**
* Collected data for a single region visited by the avatar.
*/
class PerRegionStats : public LLRefCount
@@ -107,6 +114,7 @@ public:
{
reset();
}
+ // Default assignment and destructor are correct.
void reset();
@@ -114,9 +122,9 @@ public:
LLUUID mRegionID;
struct
{
- LLSimpleStatCounter mEnqueued;
- LLSimpleStatCounter mDequeued;
- LLSimpleStatMMM<> mResponse;
+ LLSimpleStatCounter mEnqueued;
+ LLSimpleStatCounter mDequeued;
+ LLSimpleStatMMM<duration_t> mResponse;
} mRequests [EVACCount];
};
@@ -137,7 +145,7 @@ public:
// Non-Cached GET Requests
void recordGetEnqueued(LLViewerAssetType::EType at, bool with_http, bool is_temp);
void recordGetDequeued(LLViewerAssetType::EType at, bool with_http, bool is_temp);
- void recordGetServiced(LLViewerAssetType::EType at, bool with_http, bool is_temp, F64 duration);
+ void recordGetServiced(LLViewerAssetType::EType at, bool with_http, bool is_temp, duration_t duration);
// Retrieve current metrics for all visited regions.
const LLSD asLLSD() const;
@@ -180,23 +188,51 @@ extern LLViewerAssetStats * gViewerAssetStatsThread1;
namespace LLViewerAssetStatsFF
{
+/**
+ * We have many timers, clocks etc. in the runtime. This is the
+ * canonical timestamp for these metrics which is compatible with
+ * the pre-existing timestamping in the texture fetcher.
+ */
+inline LLViewerAssetStats::duration_t get_timestamp()
+{
+ return LLTimer::getTotalTime();
+}
+/**
+ * Region context, event and duration loggers for the Main thread.
+ */
void set_region_main(const LLUUID & region_id);
void record_enqueue_main(LLViewerAssetType::EType at, bool with_http, bool is_temp);
void record_dequeue_main(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-void record_response_main(LLViewerAssetType::EType at, bool with_http, bool is_temp, F64 duration);
+void record_response_main(LLViewerAssetType::EType at, bool with_http, bool is_temp,
+ LLViewerAssetStats::duration_t duration);
+/**
+ * Region context, event and duration loggers for Thread 1.
+ */
void set_region_thread1(const LLUUID & region_id);
void record_enqueue_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp);
void record_dequeue_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-void record_response_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp, F64 duration);
+void record_response_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp,
+ LLViewerAssetStats::duration_t duration);
+
+/**
+ * @brief Allocation and deallocation of globals.
+ *
+ * init() should be called before threads are started that will access it though
+ * you'll likely get away with calling it afterwards. cleanup() should only be
+ * called after threads are shutdown to prevent races on the global pointers.
+ */
+void init();
+
+void cleanup();
} // namespace LLViewerAssetStatsFF