summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerstats.cpp')
-rwxr-xr-xindra/newview/llviewerstats.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index bccd4c1a60..28c6b59391 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -733,6 +733,10 @@ void send_stats()
LLHTTPClient::post(url, body, new ViewerStatsResponder());
}
+LLViewerStats::PhaseMap::PhaseMap()
+{
+}
+
LLTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name)
{
phase_map_t::iterator iter = mPhaseMap.find(phase_name);
@@ -761,32 +765,26 @@ void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name)
{
// Going from started to paused state - record stats.
recordPhaseStat(phase_name,iter->second.getElapsedTimeF32());
+ iter->second.stop();
}
- lldebugs << "stopPhase " << phase_name << llendl;
- iter->second.stop();
- }
- else
- {
- lldebugs << "stopPhase " << phase_name << " is not started, no-op" << llendl;
}
}
-void LLViewerStats::PhaseMap::stopAllPhases()
+bool LLViewerStats::PhaseMap::getPhaseValues(const std::string& phase_name, F32& elapsed, bool& completed)
{
- for (phase_map_t::iterator iter = mPhaseMap.begin();
- iter != mPhaseMap.end(); ++iter)
+ phase_map_t::iterator iter = mPhaseMap.find(phase_name);
+ if (iter != mPhaseMap.end())
{
- const std::string& phase_name = iter->first;
- if (iter->second.getStarted())
- {
- // Going from started to paused state - record stats.
- recordPhaseStat(phase_name,iter->second.getElapsedTimeF32());
- }
- lldebugs << "stopPhase (all) " << phase_name << llendl;
- iter->second.stop();
+ elapsed = iter->second.getElapsedTimeF32();
+ completed = !iter->second.getStarted();
+ return true;
+ }
+ else
+ {
+ return false;
}
}
-
+
void LLViewerStats::PhaseMap::clearPhases()
{
lldebugs << "clearPhases" << llendl;
@@ -810,10 +808,6 @@ LLSD LLViewerStats::PhaseMap::dumpPhases()
//static
LLViewerStats::phase_stats_t LLViewerStats::PhaseMap::sStats;
-LLViewerStats::PhaseMap::PhaseMap()
-{
-}
-
// static
LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name)
{