summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-11-12 12:10:44 -0500
committerNat Goodspeed <nat@lindenlab.com>2021-11-12 12:10:44 -0500
commit5188a26a8521251dda07ac0140bb129f28417e49 (patch)
tree3a2239ad294f3cd33926416264e0bcbe520e8b9c /indra/llui
parent75110629de7786d667ea7c90b025f97c22650316 (diff)
parent819088563e13f1d75e048311fbaf0df4a79b7e19 (diff)
SL-16220: Merge branch 'origin/DRTVWR-546' into glthread
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llstatbar.cpp17
-rw-r--r--indra/llui/llstatbar.h6
2 files changed, 19 insertions, 4 deletions
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 8adcd664df..2449100952 100644
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -160,6 +160,7 @@ LLStatBar::Params::Params()
tick_spacing("tick_spacing", 0.f),
decimal_digits("decimal_digits", 3),
show_bar("show_bar", false),
+ show_median("show_median", false),
show_history("show_history", false),
scale_range("scale_range", true),
num_frames("num_frames", 200),
@@ -186,6 +187,7 @@ LLStatBar::LLStatBar(const Params& p)
mNumShortHistoryFrames(p.num_frames_short),
mMaxHeight(p.max_height),
mDisplayBar(p.show_bar),
+ mShowMedian(p.show_median),
mDisplayHistory(p.show_history),
mOrientation(p.orientation),
mAutoScaleMax(!p.bar_max.isProvided()),
@@ -318,7 +320,14 @@ void LLStatBar::draw()
min = frame_recording.getPeriodMinPerSec(count_stat, num_frames);
max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames);
mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames);
- display_value = mean;
+ if (mShowMedian)
+ {
+ display_value = frame_recording.getPeriodMedianPerSec(count_stat, num_frames);
+ }
+ else
+ {
+ display_value = mean;
+ }
}
break;
case STAT_EVENT:
@@ -344,7 +353,11 @@ void LLStatBar::draw()
mean = frame_recording.getPeriodMean(sample_stat, num_frames);
num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW);
- if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC)
+ if (mShowMedian)
+ {
+ display_value = frame_recording.getPeriodMedian(sample_stat, num_frames);
+ }
+ else if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC)
{
display_value = mean;
}
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 1ff4c67fc5..6b481ca68f 100644
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -44,9 +44,10 @@ public:
bar_max,
tick_spacing;
- Optional<bool> show_bar,
+ Optional<bool> show_bar,
show_history,
- scale_range;
+ scale_range,
+ show_median; // default is mean
Optional<S32> decimal_digits,
num_frames,
@@ -112,6 +113,7 @@ private:
bool mDisplayBar, // Display the bar graph.
mDisplayHistory,
+ mShowMedian,
mAutoScaleMax,
mAutoScaleMin;
};