From b4b0800bfd8e4a92a9e7ccbfbf24be2a0b4bef4a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 Mar 2012 17:46:44 -0400 Subject: SH-2970 FIX - per-region logging of basic avatar stats --- indra/newview/tests/llviewerassetstats_test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) mode change 100644 => 100755 indra/newview/tests/llviewerassetstats_test.cpp (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp old mode 100644 new mode 100755 index 3faddc13c1..5e18f91b23 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -35,6 +35,15 @@ #include "lluuid.h" #include "llsdutil.h" #include "llregionhandle.h" +#include "../llvoavatar.h" + +void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) +{ + counts.resize(3); + counts[0] = 0; + counts[1] = 0; + counts[2] = 1; +} static const char * all_keys[] = { -- cgit v1.2.3 From 7c14e354aedf5de21a3255a467750a09f18e33eb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 2 Apr 2012 17:26:38 -0400 Subject: SH-3064 WIP - centralized logic for mapping rez status S32 values to strings --- indra/newview/tests/llviewerassetstats_test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 5e18f91b23..ba760c0695 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -45,6 +45,15 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) counts[2] = 1; } +// static +std::string LLVOAvatar::rezStatusToString(S32 rez_status) +{ + if (rez_status==0) return "cloud"; + if (rez_status=1) return "gray"; + if (rez_status=2) return "textured"; + return "unknown"; +} + static const char * all_keys[] = { "duration", -- cgit v1.2.3 From cd12a3bba9da830b98d53a207daca20c29035cc5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 3 Apr 2012 17:37:32 -0400 Subject: fixed integration test bug revealed by mac compiler pickiness --- indra/newview/tests/llviewerassetstats_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index ba760c0695..56d2004c17 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -49,8 +49,8 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) std::string LLVOAvatar::rezStatusToString(S32 rez_status) { if (rez_status==0) return "cloud"; - if (rez_status=1) return "gray"; - if (rez_status=2) return "textured"; + if (rez_status==1) return "gray"; + if (rez_status==2) return "textured"; return "unknown"; } -- cgit v1.2.3 From e4cced82343391292e61db03bb019e19827834c7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 9 Apr 2012 17:57:50 -0400 Subject: SH-3064 FIX - added cloud and cloud-or-gray stats to summary metrics. Moved summary metrics out of per-region info. Removed phase stats from avatar appearance change msg. --- indra/newview/tests/llviewerassetstats_test.cpp | 33 +++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 56d2004c17..356c5b8261 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -45,6 +45,12 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) counts[2] = 1; } +LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name) +{ + static std::map stats_map; + return stats_map[phase_name]; +} + // static std::string LLVOAvatar::rezStatusToString(S32 rez_status) { @@ -130,10 +136,17 @@ is_double_key_map(const LLSD & sd, const std::string & key1, const std::string & return sd.isMap() && 2 == sd.size() && sd.has(key1) && sd.has(key2); } +static bool +is_triple_key_map(const LLSD & sd, const std::string & key1, const std::string & key2, const std::string& key3) +{ + return sd.isMap() && 3 == sd.size() && sd.has(key1) && sd.has(key2) && sd.has(key3); +} + + static bool is_no_stats_map(const LLSD & sd) { - return is_double_key_map(sd, "duration", "regions"); + return is_triple_key_map(sd, "duration", "regions", "avatar"); } static bool @@ -244,7 +257,7 @@ namespace tut // Once the region is set, we will get a response even with no data collection it->setRegion(region1_handle); sd_full = it->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd_full, "duration", "regions")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd_full, "duration", "regions", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd_full["regions"], region1_handle)); LLSD sd = sd_full["regions"][0]; @@ -285,7 +298,7 @@ namespace tut it->setRegion(region1_handle); LLSD sd = it->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = sd[0]; @@ -310,7 +323,7 @@ namespace tut LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false); LLSD sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = sd["regions"][0]; @@ -350,7 +363,7 @@ namespace tut LLSD sd = gViewerAssetStatsThread1->asLLSD(false); ensure("Other collector is empty", is_no_stats_map(sd)); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = sd["regions"][0]; @@ -400,7 +413,7 @@ namespace tut // std::cout << sd << std::endl; - ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions")); + ensure("Correct double-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar")); ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle)); LLSD sd1 = get_region(sd, region1_handle); LLSD sd2 = get_region(sd, region2_handle); @@ -423,7 +436,7 @@ namespace tut // Reset leaves current region in place gViewerAssetStatsMain->reset(); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle)); sd2 = sd["regions"][0]; @@ -472,7 +485,7 @@ namespace tut LLSD sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions")); + ensure("Correct double-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar")); ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle)); LLSD sd1 = get_region(sd, region1_handle); LLSD sd2 = get_region(sd, region2_handle); @@ -495,7 +508,7 @@ namespace tut // Reset leaves current region in place gViewerAssetStatsMain->reset(); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "duration", "regions")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar")); ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle)); sd2 = get_region(sd, region2_handle); ensure("Region2 is present in results", sd2.isMap()); @@ -541,7 +554,7 @@ namespace tut LLSD sd = gViewerAssetStatsThread1->asLLSD(false); ensure("Other collector is empty", is_no_stats_map(sd)); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = get_region(sd, region1_handle); ensure("Region1 is present in results", sd.isMap()); -- cgit v1.2.3 From 724863423142b55d536bd40c12d8a203a6de2468 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 9 Apr 2012 18:35:28 -0400 Subject: possible fix for linux build failure --- indra/newview/tests/llviewerassetstats_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 356c5b8261..952f0f1a6e 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -128,13 +128,13 @@ is_single_key_map(const LLSD & sd, const std::string & key) { return sd.isMap() && 1 == sd.size() && sd.has(key); } -#endif static bool is_double_key_map(const LLSD & sd, const std::string & key1, const std::string & key2) { return sd.isMap() && 2 == sd.size() && sd.has(key1) && sd.has(key2); } +#endif static bool is_triple_key_map(const LLSD & sd, const std::string & key1, const std::string & key2, const std::string& key3) -- cgit v1.2.3 From 7fbf42dec8bae638b62676c280b3f042f9458057 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Apr 2012 14:52:44 -0400 Subject: Move phase tracking to its own set of classes inside LLViewerStats - simplifies llvoavatar and allows adding such tracking to classes that live outside the avatar lifetime --- indra/newview/tests/llviewerassetstats_test.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/tests') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 952f0f1a6e..f8923b9868 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -45,12 +45,6 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) counts[2] = 1; } -LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name) -{ - static std::map stats_map; - return stats_map[phase_name]; -} - // static std::string LLVOAvatar::rezStatusToString(S32 rez_status) { @@ -60,6 +54,13 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status) return "unknown"; } +// static +LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name) +{ + static LLViewerStats::StatsAccumulator junk; + return junk; +} + static const char * all_keys[] = { "duration", -- cgit v1.2.3