summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llviewerassetstats.cpp157
-rw-r--r--indra/newview/llviewerassetstats.h27
-rw-r--r--indra/newview/tests/llviewerassetstats_test.cpp51
3 files changed, 134 insertions, 101 deletions
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index f74b394d78..0852573bbd 100644
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -65,7 +65,7 @@ namespace
{
static LLViewerAssetStats::EViewerAssetCategories
-asset_type_to_category(const LLViewerAssetType::EType at);
+asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool is_temp);
}
@@ -90,25 +90,25 @@ LLViewerAssetStats::reset()
}
void
-LLViewerAssetStats::recordGetEnqueued(LLViewerAssetType::EType at)
+LLViewerAssetStats::recordGetEnqueued(LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
- const EViewerAssetCategories eac(asset_type_to_category(at));
+ const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
++mRequests[int(eac)].mEnqueued;
}
void
-LLViewerAssetStats::recordGetDequeued(LLViewerAssetType::EType at)
+LLViewerAssetStats::recordGetDequeued(LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
- const EViewerAssetCategories eac(asset_type_to_category(at));
+ const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
++mRequests[int(eac)].mDequeued;
}
void
-LLViewerAssetStats::recordGetServiced(LLViewerAssetType::EType at, F64 duration)
+LLViewerAssetStats::recordGetServiced(LLViewerAssetType::EType at, bool with_http, bool is_temp, F64 duration)
{
- const EViewerAssetCategories eac(asset_type_to_category(at));
+ const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
mRequests[int(eac)].mResponse.record(duration);
}
@@ -119,10 +119,13 @@ LLViewerAssetStats::asLLSD() const
// Top-level tags
static const LLSD::String tags[EVACCount] =
{
- LLSD::String("get_texture"),
- LLSD::String("get_wearable"),
- LLSD::String("get_sound"),
- LLSD::String("get_gesture"),
+ LLSD::String("get_texture_temp_http"),
+ LLSD::String("get_texture_temp_udp"),
+ LLSD::String("get_texture_non_temp_http"),
+ LLSD::String("get_texture_non_temp_udp"),
+ LLSD::String("get_wearable_udp"),
+ LLSD::String("get_sound_udp"),
+ LLSD::String("get_gesture_udp"),
LLSD::String("get_other")
};
@@ -159,30 +162,30 @@ namespace LLViewerAssetStatsFF
{
void
-record_enqueue(LLViewerAssetType::EType at)
+record_enqueue(LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
if (! gViewerAssetStats)
return;
- gViewerAssetStats->recordGetEnqueued(at);
+ gViewerAssetStats->recordGetEnqueued(at, with_http, is_temp);
}
void
-record_dequeue(LLViewerAssetType::EType at)
+record_dequeue(LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
if (! gViewerAssetStats)
return;
- gViewerAssetStats->recordGetDequeued(at);
+ gViewerAssetStats->recordGetDequeued(at, with_http, is_temp);
}
void
-record_response(LLViewerAssetType::EType at, F64 duration)
+record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp, F64 duration)
{
if (! gViewerAssetStats)
return;
- gViewerAssetStats->recordGetServiced(at, duration);
+ gViewerAssetStats->recordGetServiced(at, with_http, is_temp, duration);
}
} // namespace LLViewerAssetStatsFF
@@ -196,7 +199,7 @@ namespace
{
LLViewerAssetStats::EViewerAssetCategories
-asset_type_to_category(const LLViewerAssetType::EType at)
+asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
// For statistical purposes, we divide GETs into several
// populations of asset fetches:
@@ -213,57 +216,57 @@ asset_type_to_category(const LLViewerAssetType::EType at)
// maintenance and attention.
static const LLViewerAssetStats::EViewerAssetCategories asset_to_bin_map[LLViewerAssetType::AT_COUNT] =
{
- LLViewerAssetStats::EVACTextureGet, // (0) AT_TEXTURE
- LLViewerAssetStats::EVACSoundGet, // AT_SOUND
- LLViewerAssetStats::EVACOtherGet, // AT_CALLINGCARD
- LLViewerAssetStats::EVACOtherGet, // AT_LANDMARK
- LLViewerAssetStats::EVACOtherGet, // AT_SCRIPT
- LLViewerAssetStats::EVACWearableGet, // AT_CLOTHING
- LLViewerAssetStats::EVACOtherGet, // AT_OBJECT
- LLViewerAssetStats::EVACOtherGet, // AT_NOTECARD
- LLViewerAssetStats::EVACOtherGet, // AT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // AT_ROOT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // (10) AT_LSL_TEXT
- LLViewerAssetStats::EVACOtherGet, // AT_LSL_BYTECODE
- LLViewerAssetStats::EVACOtherGet, // AT_TEXTURE_TGA
- LLViewerAssetStats::EVACWearableGet, // AT_BODYPART
- LLViewerAssetStats::EVACOtherGet, // AT_TRASH
- LLViewerAssetStats::EVACOtherGet, // AT_SNAPSHOT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // AT_LOST_AND_FOUND
- LLViewerAssetStats::EVACSoundGet, // AT_SOUND_WAV
- LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_TGA
- LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_JPEG
- LLViewerAssetStats::EVACGestureGet, // (20) AT_ANIMATION
- LLViewerAssetStats::EVACGestureGet, // AT_GESTURE
- LLViewerAssetStats::EVACOtherGet, // AT_SIMSTATE
- LLViewerAssetStats::EVACOtherGet, // AT_FAVORITE
- LLViewerAssetStats::EVACOtherGet, // AT_LINK
- LLViewerAssetStats::EVACOtherGet, // AT_LINK_FOLDER
+ LLViewerAssetStats::EVACTextureTempHTTPGet, // (0) AT_TEXTURE
+ LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND
+ LLViewerAssetStats::EVACOtherGet, // AT_CALLINGCARD
+ LLViewerAssetStats::EVACOtherGet, // AT_LANDMARK
+ LLViewerAssetStats::EVACOtherGet, // AT_SCRIPT
+ LLViewerAssetStats::EVACWearableUDPGet, // AT_CLOTHING
+ LLViewerAssetStats::EVACOtherGet, // AT_OBJECT
+ LLViewerAssetStats::EVACOtherGet, // AT_NOTECARD
+ LLViewerAssetStats::EVACOtherGet, // AT_CATEGORY
+ LLViewerAssetStats::EVACOtherGet, // AT_ROOT_CATEGORY
+ LLViewerAssetStats::EVACOtherGet, // (10) AT_LSL_TEXT
+ LLViewerAssetStats::EVACOtherGet, // AT_LSL_BYTECODE
+ LLViewerAssetStats::EVACOtherGet, // AT_TEXTURE_TGA
+ LLViewerAssetStats::EVACWearableUDPGet, // AT_BODYPART
+ LLViewerAssetStats::EVACOtherGet, // AT_TRASH
+ LLViewerAssetStats::EVACOtherGet, // AT_SNAPSHOT_CATEGORY
+ LLViewerAssetStats::EVACOtherGet, // AT_LOST_AND_FOUND
+ LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND_WAV
+ LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_TGA
+ LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_JPEG
+ LLViewerAssetStats::EVACGestureUDPGet, // (20) AT_ANIMATION
+ LLViewerAssetStats::EVACGestureUDPGet, // AT_GESTURE
+ LLViewerAssetStats::EVACOtherGet, // AT_SIMSTATE
+ LLViewerAssetStats::EVACOtherGet, // AT_FAVORITE
+ LLViewerAssetStats::EVACOtherGet, // AT_LINK
+ LLViewerAssetStats::EVACOtherGet, // AT_LINK_FOLDER
#if 0
// When LLViewerAssetType::AT_COUNT == 49
- LLViewerAssetStats::EVACOtherGet, // AT_FOLDER_ENSEMBLE_START
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // (30)
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // (40)
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // AT_FOLDER_ENSEMBLE_END
- LLViewerAssetStats::EVACOtherGet, // AT_CURRENT_OUTFIT
- LLViewerAssetStats::EVACOtherGet, // AT_OUTFIT
- LLViewerAssetStats::EVACOtherGet // AT_MY_OUTFITS
+ LLViewerAssetStats::EVACOtherGet, // AT_FOLDER_ENSEMBLE_START
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, // (30)
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, // (40)
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, //
+ LLViewerAssetStats::EVACOtherGet, // AT_FOLDER_ENSEMBLE_END
+ LLViewerAssetStats::EVACOtherGet, // AT_CURRENT_OUTFIT
+ LLViewerAssetStats::EVACOtherGet, // AT_OUTFIT
+ LLViewerAssetStats::EVACOtherGet // AT_MY_OUTFITS
#endif
};
@@ -271,7 +274,25 @@ asset_type_to_category(const LLViewerAssetType::EType at)
{
return LLViewerAssetStats::EVACOtherGet;
}
- return asset_to_bin_map[at];
+ LLViewerAssetStats::EViewerAssetCategories ret(asset_to_bin_map[at]);
+ if (LLViewerAssetStats::EVACTextureTempHTTPGet == ret)
+ {
+ // Indexed with [is_temp][with_http]
+ static const LLViewerAssetStats::EViewerAssetCategories texture_bin_map[2][2] =
+ {
+ {
+ LLViewerAssetStats::EVACTextureNonTempUDPGet,
+ LLViewerAssetStats::EVACTextureNonTempHTTPGet,
+ },
+ {
+ LLViewerAssetStats::EVACTextureTempUDPGet,
+ LLViewerAssetStats::EVACTextureTempHTTPGet,
+ }
+ };
+
+ ret = texture_bin_map[is_temp][with_http];
+ }
+ return ret;
}
} // anonymous namespace
diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h
index b56fe008e3..9d66a1e89b 100644
--- a/indra/newview/llviewerassetstats.h
+++ b/indra/newview/llviewerassetstats.h
@@ -89,21 +89,24 @@ public:
enum EViewerAssetCategories
{
- EVACTextureGet, //< Texture GETs
- EVACWearableGet, //< Wearable GETs
- EVACSoundGet, //< Sound GETs
- EVACGestureGet, //< Gesture GETs
- EVACOtherGet, //< Other GETs
+ EVACTextureTempHTTPGet, //< Texture GETs
+ EVACTextureTempUDPGet, //< Texture GETs
+ EVACTextureNonTempHTTPGet, //< Texture GETs
+ EVACTextureNonTempUDPGet, //< Texture GETs
+ EVACWearableUDPGet, //< Wearable GETs
+ EVACSoundUDPGet, //< Sound GETs
+ EVACGestureUDPGet, //< Gesture GETs
+ EVACOtherGet, //< Other GETs
- EVACCount // Must be last
+ EVACCount // Must be last
};
void reset();
// Non-Cached GET Requests
- void recordGetEnqueued(LLViewerAssetType::EType at);
- void recordGetDequeued(LLViewerAssetType::EType at);
- void recordGetServiced(LLViewerAssetType::EType at, F64 duration);
+ 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);
// Report Generation
const LLSD asLLSD() const;
@@ -131,11 +134,11 @@ extern LLViewerAssetStats * gViewerAssetStats;
namespace LLViewerAssetStatsFF
{
-void record_enqueue(LLViewerAssetType::EType at);
+void record_enqueue(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-void record_dequeue(LLViewerAssetType::EType at);
+void record_dequeue(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-void record_response(LLViewerAssetType::EType at, F64 duration);
+void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp, F64 duration);
} // namespace LLViewerAssetStatsFF
diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp
index 5c6cc1c8c8..50d348c7e3 100644
--- a/indra/newview/tests/llviewerassetstats_test.cpp
+++ b/indra/newview/tests/llviewerassetstats_test.cpp
@@ -42,19 +42,25 @@
static const char * all_keys[] =
{
"get_other",
- "get_texture",
- "get_wearable",
- "get_sound",
- "get_gesture"
+ "get_texture_temp_http",
+ "get_texture_temp_udp",
+ "get_texture_non_temp_http",
+ "get_texture_non_temp_udp",
+ "get_wearable_udp",
+ "get_sound_udp",
+ "get_gesture_udp"
};
static const char * resp_keys[] =
{
"get_other",
- "get_texture",
- "get_wearable",
- "get_sound",
- "get_gesture"
+ "get_texture_temp_http",
+ "get_texture_temp_udp",
+ "get_texture_non_temp_http",
+ "get_texture_non_temp_udp",
+ "get_wearable_udp",
+ "get_sound_udp",
+ "get_gesture_udp"
};
static const char * sub_keys[] =
@@ -82,11 +88,11 @@ namespace tut
// Check that helpers aren't bothered by missing global stats
ensure("Global gViewerAssetStats should be NULL", (NULL == gViewerAssetStats));
- LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_response(LLViewerAssetType::AT_GESTURE, 12.3);
+ LLViewerAssetStatsFF::record_response(LLViewerAssetType::AT_GESTURE, false, false, 12.3);
}
// Create a non-global instance and check the structure
@@ -131,8 +137,8 @@ namespace tut
delete it;
// Check a few points on the tree for content
- ensure("sd[get_texture][dequeued] is 0", (0 == sd["get_texture"]["dequeued"].asInteger()));
- ensure("sd[get_sound][resp_min] is 0", (0.0 == sd["get_sound"]["resp_min"].asReal()));
+ ensure("sd[get_texture_temp_http][dequeued] is 0", (0 == sd["get_texture_temp_http"]["dequeued"].asInteger()));
+ ensure("sd[get_sound_udp][resp_min] is 0", (0.0 == sd["get_sound_udp"]["resp_min"].asReal()));
}
// Create a global instance and verify free functions do something useful
@@ -141,17 +147,20 @@ namespace tut
{
gViewerAssetStats = new LLViewerAssetStats();
- LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE);
- LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART);
- LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, false);
LLSD sd = gViewerAssetStats->asLLSD();
// Check a few points on the tree for content
- ensure("sd[get_texture][enqueued] is 1", (1 == sd["get_texture"]["enqueued"].asInteger()));
- ensure("sd[get_gesture][dequeued] is 0", (0 == sd["get_gesture"]["dequeued"].asInteger()));
+ ensure("sd[get_texture_non_temp_udp][enqueued] is 1", (1 == sd["get_texture_non_temp_udp"]["enqueued"].asInteger()));
+ ensure("sd[get_texture_temp_udp][enqueued] is 0", (0 == sd["get_texture_temp_udp"]["enqueued"].asInteger()));
+ ensure("sd[get_texture_non_temp_http][enqueued] is 0", (0 == sd["get_texture_non_temp_http"]["enqueued"].asInteger()));
+ ensure("sd[get_texture_temp_http][enqueued] is 0", (0 == sd["get_texture_temp_http"]["enqueued"].asInteger()));
+ ensure("sd[get_gesture_udp][dequeued] is 0", (0 == sd["get_gesture_udp"]["dequeued"].asInteger()));
// Reset and check zeros...
gViewerAssetStats->reset();
@@ -160,8 +169,8 @@ namespace tut
delete gViewerAssetStats;
gViewerAssetStats = NULL;
- ensure("sd[get_texture][enqueued] is reset", (0 == sd["get_texture"]["enqueued"].asInteger()));
- ensure("sd[get_gesture][dequeued] is reset", (0 == sd["get_gesture"]["dequeued"].asInteger()));
+ ensure("sd[get_texture_non_temp_udp][enqueued] is reset", (0 == sd["get_texture_non_temp_udp"]["enqueued"].asInteger()));
+ ensure("sd[get_gesture_udp][dequeued] is reset", (0 == sd["get_gesture_udp"]["dequeued"].asInteger()));
}
}