diff options
author | Merov Linden <merov@lindenlab.com> | 2010-11-08 17:16:31 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2010-11-08 17:16:31 -0800 |
commit | b5df1d2abcef04ee5f491a7414189f4e82faaa1e (patch) | |
tree | 1e8d59da3e0473f300d99bd683cd1486de3b31e2 /indra/llcommon/llmetricperformancetester.cpp | |
parent | 85509457c6dc6a0f3e56fa3d24ae872e1878c04f (diff) |
STORM-105 : takes Vadim's comments into account, clean up use of static globals and magic strings, enforce naming conventions
Diffstat (limited to 'indra/llcommon/llmetricperformancetester.cpp')
-rw-r--r-- | indra/llcommon/llmetricperformancetester.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 2110192fbc..5fa3a5ea07 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -67,6 +67,7 @@ BOOL LLMetricPerformanceTesterBasic::addTester(LLMetricPerformanceTesterBasic* t /*static*/ LLMetricPerformanceTesterBasic* LLMetricPerformanceTesterBasic::getTester(std::string name) { + // Check for the requested metric name name_tester_map_t::iterator found_it = sTesterMap.find(name) ; if (found_it != sTesterMap.end()) { @@ -74,6 +75,14 @@ LLMetricPerformanceTesterBasic* LLMetricPerformanceTesterBasic::getTester(std::s } return NULL ; } + +/*static*/ +// Return TRUE if this metric is requested or if the general default "catch all" metric is requested +BOOL LLMetricPerformanceTesterBasic::isMetricLogRequested(std::string name) +{ + return (LLFastTimer::sMetricLog && ((LLFastTimer::sLogName == name) || (LLFastTimer::sLogName == DEFAULT_METRIC_NAME))); +} + //---------------------------------------------------------------------------------------------- // LLMetricPerformanceTesterBasic : Tester instance methods @@ -126,13 +135,13 @@ void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* { resetCurrentCount() ; - std::string currentLabel = getCurrentLabelName(); - BOOL in_base = (*base).has(currentLabel) ; - BOOL in_current = (*current).has(currentLabel) ; + std::string current_label = getCurrentLabelName(); + BOOL in_base = (*base).has(current_label) ; + BOOL in_current = (*current).has(current_label) ; while(in_base || in_current) { - LLSD::String label = currentLabel ; + LLSD::String label = current_label ; if(in_base && in_current) { @@ -157,9 +166,9 @@ void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD* } incrementCurrentCount(); - currentLabel = getCurrentLabelName(); - in_base = (*base).has(currentLabel) ; - in_current = (*current).has(currentLabel) ; + current_label = getCurrentLabelName(); + in_base = (*base).has(current_label) ; + in_current = (*current).has(current_label) ; } } |