summaryrefslogtreecommitdiff
path: root/indra/newview/llfasttimerview.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-04-07 00:29:02 -0500
committerDave Parks <davep@lindenlab.com>2011-04-07 00:29:02 -0500
commitf90eb750f1e8c3e300d1a079fe99d15f35201072 (patch)
tree909c6a56ad4af2f1c0bab0f312db74cfb63f49ea /indra/newview/llfasttimerview.cpp
parente52613aad6bc2a9ec2b20171e59fee5a124d5765 (diff)
SH-1292 Remove outliers from graphs in scene console to make a more useful view.
Diffstat (limited to 'indra/newview/llfasttimerview.cpp')
-rwxr-xr-xindra/newview/llfasttimerview.cpp45
1 files changed, 4 insertions, 41 deletions
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 6e78ea6bbe..35712163eb 100755
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -1040,43 +1040,6 @@ void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch
result->save(out_file);
}
-template <class VEC_TYPE>
-void removeOutliers(std::vector<VEC_TYPE>& data, F32 k)
-{
- if (data.size() < 100)
- { //not enough samples
- return;
- }
-
- VEC_TYPE Q1 = data[data.size()/4];
- VEC_TYPE Q3 = data[data.size()-data.size()/4-1];
-
- VEC_TYPE min = Q1-k*(Q3-Q1);
- VEC_TYPE max = Q3+k*(Q3-Q1);
-
- U32 i = 0;
- while (i < data.size() && data[i] < min)
- {
- i++;
- }
-
- S32 j = data.size()-1;
- while (j > 0 && data[j] > max)
- {
- j--;
- }
-
- if (j < data.size()-1)
- {
- data.erase(data.begin()+j, data.end());
- }
-
- if (i > 0)
- {
- data.erase(data.begin(), data.begin()+i);
- }
-}
-
//static
void LLFastTimerView::exportCharts(const std::string& base, const std::string& target)
{
@@ -1206,22 +1169,22 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t
const U32 OUTLIER_CUTOFF = 512;
if (base_times.size() > OUTLIER_CUTOFF)
{
- removeOutliers(base_times, 1.f);
+ ll_remove_outliers(base_times, 1.f);
}
if (base_execution.size() > OUTLIER_CUTOFF)
{
- removeOutliers(base_execution, 1.f);
+ ll_remove_outliers(base_execution, 1.f);
}
if (cur_times.size() > OUTLIER_CUTOFF)
{
- removeOutliers(cur_times, 1.f);
+ ll_remove_outliers(cur_times, 1.f);
}
if (cur_execution.size() > OUTLIER_CUTOFF)
{
- removeOutliers(cur_execution, 1.f);
+ ll_remove_outliers(cur_execution, 1.f);
}