From 86449a0ac4cb1432a55c17bfabe83c4c42c096a8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 14 Feb 2017 09:31:08 -0500 Subject: SL-409 - debug setting to enable/disable use of ViewerAsset cap by asset type. Temporary construction until UDP path goes away. --- indra/llcommon/llassettype.cpp | 93 +++++++++++++++++++++++++++++++++++++++++- indra/llcommon/llassettype.h | 5 +++ 2 files changed, 97 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 4304db36be..6ecc2ec740 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -31,6 +31,9 @@ #include "llmemory.h" #include "llsingleton.h" +#include +#include + ///---------------------------------------------------------------------------- /// Class LLAssetType ///---------------------------------------------------------------------------- @@ -48,7 +51,8 @@ struct AssetEntry : public LLDictionaryEntry mHumanName(human_name), mCanLink(can_link), mCanFetch(can_fetch), - mCanKnow(can_know) + mCanKnow(can_know), + mFetchWithVACap(false) { llassert(strlen(mTypeName) <= 8); } @@ -58,6 +62,7 @@ struct AssetEntry : public LLDictionaryEntry bool mCanLink; bool mCanFetch; bool mCanKnow; + bool mFetchWithVACap; }; class LLAssetDictionary : public LLSingleton, @@ -251,3 +256,89 @@ bool LLAssetType::lookupIsAssetIDKnowable(EType asset_type) } return false; } + +// static +bool LLAssetType::lookupFetchWithVACap(EType asset_type) +{ + LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + const AssetEntry *entry = dict->lookup(asset_type); + if (entry) + { + return entry->mFetchWithVACap; + } + return false; +} + +// FIXME asset-http yank all this after asset-http becomes universal +void LLAssetType::setFetchWithVACapTypeString(const std::string& type_string) +{ + LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + if (type_string=="none") + { + for (LLAssetDictionary::iterator iter = dict->begin(); + iter != dict->end(); + iter++) + { + AssetEntry *entry = iter->second; + entry->mFetchWithVACap = false; + } + } + else if (type_string=="all") + { + for (LLAssetDictionary::iterator iter = dict->begin(); + iter != dict->end(); + iter++) + { + AssetEntry *entry = iter->second; + entry->mFetchWithVACap = true; + } + } + else + { + for (LLAssetDictionary::iterator iter = dict->begin(); + iter != dict->end(); + iter++) + { + AssetEntry *entry = iter->second; + if (entry->mTypeName==type_string) + { + entry->mFetchWithVACap = true; + } + } + } +} + +// FIXME asset-http yank all this after asset-http becomes universal +void LLAssetType::setFetchWithVACapConfigString(const std::string& config_string) +{ + // Clear any currently enabled types + LLAssetType::setFetchWithVACapTypeString("none"); + + // Enable all types specified in the config string. + std::set type_names_for_va_cap; + boost::split(type_names_for_va_cap, config_string, boost::is_any_of(" :,")); + for (std::set::const_iterator it = type_names_for_va_cap.begin(); + it != type_names_for_va_cap.end(); ++it) + { + const std::string& type_string = *it; + LLAssetType::setFetchWithVACapTypeString(type_string); + } + + LLAssetDictionary *dict = LLAssetDictionary::getInstance(); + bool any_found = false; + for (LLAssetDictionary::iterator iter = dict->begin(); + iter != dict->end(); + iter++) + { + AssetEntry *entry = iter->second; + if (entry->mFetchWithVACap) + { + any_found = true; + LL_WARNS() << "Fetch with ViewerAsset cap enabled for " << entry->mTypeName << LL_ENDL; + } + } + if (!any_found) + { + LL_WARNS() << "Fetch with ViewerAsset cap disabled for all types" << LL_ENDL; + } +} diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index 3a4b5dad18..e06ebc2a35 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -152,6 +152,11 @@ public: static bool lookupIsAssetFetchByIDAllowed(EType asset_type); // the asset allows direct download static bool lookupIsAssetIDKnowable(EType asset_type); // asset data can be known by the viewer + + static bool lookupFetchWithVACap(EType asset_type); // asset data is fetched via http using ViewerAsset cap. + + static void setFetchWithVACapTypeString(const std::string& type_string); + static void setFetchWithVACapConfigString(const std::string& config_string); static const std::string& badLookup(); // error string when a lookup fails -- cgit v1.2.3 From f70abb4ad628b19c993a22c7e86d350395555fcf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 3 Mar 2017 15:14:09 -0500 Subject: SL-409 - added tracking for bytes fetched to viewer assets metrics (does not currently work for textures) --- indra/llcommon/llerror.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index e6407ecf22..9c49f7eff4 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -572,7 +572,7 @@ namespace LLError mFunctionString += std::string(mFunction) + ":"; for (size_t i = 0; i < mTagCount; i++) { - mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : ","); + mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? " " : ","); } } -- cgit v1.2.3 From 17384ce6c43a9e07031d7deeea4ec9bbee76199c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 20 Mar 2017 16:04:02 -0400 Subject: MAINT-7195 work (can't repro), removed UDP fetching path, handle more possible timing issues while connecting to region --- indra/llcommon/llassettype.cpp | 90 +----------------------------------------- indra/llcommon/llassettype.h | 5 --- 2 files changed, 1 insertion(+), 94 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 6ecc2ec740..5e8129b9b2 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -51,8 +51,7 @@ struct AssetEntry : public LLDictionaryEntry mHumanName(human_name), mCanLink(can_link), mCanFetch(can_fetch), - mCanKnow(can_know), - mFetchWithVACap(false) + mCanKnow(can_know) { llassert(strlen(mTypeName) <= 8); } @@ -62,7 +61,6 @@ struct AssetEntry : public LLDictionaryEntry bool mCanLink; bool mCanFetch; bool mCanKnow; - bool mFetchWithVACap; }; class LLAssetDictionary : public LLSingleton, @@ -256,89 +254,3 @@ bool LLAssetType::lookupIsAssetIDKnowable(EType asset_type) } return false; } - -// static -bool LLAssetType::lookupFetchWithVACap(EType asset_type) -{ - LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - const AssetEntry *entry = dict->lookup(asset_type); - if (entry) - { - return entry->mFetchWithVACap; - } - return false; -} - -// FIXME asset-http yank all this after asset-http becomes universal -void LLAssetType::setFetchWithVACapTypeString(const std::string& type_string) -{ - LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - if (type_string=="none") - { - for (LLAssetDictionary::iterator iter = dict->begin(); - iter != dict->end(); - iter++) - { - AssetEntry *entry = iter->second; - entry->mFetchWithVACap = false; - } - } - else if (type_string=="all") - { - for (LLAssetDictionary::iterator iter = dict->begin(); - iter != dict->end(); - iter++) - { - AssetEntry *entry = iter->second; - entry->mFetchWithVACap = true; - } - } - else - { - for (LLAssetDictionary::iterator iter = dict->begin(); - iter != dict->end(); - iter++) - { - AssetEntry *entry = iter->second; - if (entry->mTypeName==type_string) - { - entry->mFetchWithVACap = true; - } - } - } -} - -// FIXME asset-http yank all this after asset-http becomes universal -void LLAssetType::setFetchWithVACapConfigString(const std::string& config_string) -{ - // Clear any currently enabled types - LLAssetType::setFetchWithVACapTypeString("none"); - - // Enable all types specified in the config string. - std::set type_names_for_va_cap; - boost::split(type_names_for_va_cap, config_string, boost::is_any_of(" :,")); - for (std::set::const_iterator it = type_names_for_va_cap.begin(); - it != type_names_for_va_cap.end(); ++it) - { - const std::string& type_string = *it; - LLAssetType::setFetchWithVACapTypeString(type_string); - } - - LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - bool any_found = false; - for (LLAssetDictionary::iterator iter = dict->begin(); - iter != dict->end(); - iter++) - { - AssetEntry *entry = iter->second; - if (entry->mFetchWithVACap) - { - any_found = true; - LL_WARNS() << "Fetch with ViewerAsset cap enabled for " << entry->mTypeName << LL_ENDL; - } - } - if (!any_found) - { - LL_WARNS() << "Fetch with ViewerAsset cap disabled for all types" << LL_ENDL; - } -} diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index e06ebc2a35..b849be9f16 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -153,11 +153,6 @@ public: static bool lookupIsAssetFetchByIDAllowed(EType asset_type); // the asset allows direct download static bool lookupIsAssetIDKnowable(EType asset_type); // asset data can be known by the viewer - static bool lookupFetchWithVACap(EType asset_type); // asset data is fetched via http using ViewerAsset cap. - - static void setFetchWithVACapTypeString(const std::string& type_string); - static void setFetchWithVACapConfigString(const std::string& config_string); - static const std::string& badLookup(); // error string when a lookup fails protected: -- cgit v1.2.3 From b7b8d6e1aedeac1dfdfcc9200024bbcc8e2dacae Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Apr 2017 12:39:14 -0400 Subject: MAINT-7343 - added periodic logging of state of the asset store. --- indra/llcommon/llassettype.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 5e8129b9b2..4304db36be 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -31,9 +31,6 @@ #include "llmemory.h" #include "llsingleton.h" -#include -#include - ///---------------------------------------------------------------------------- /// Class LLAssetType ///---------------------------------------------------------------------------- -- cgit v1.2.3