From b1baf982b1bd41a150233d0a28d3601226924c65 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 30 Sep 2012 10:41:29 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages factored out lltrace::sampler into separate file added rudimentary lltrace support to llstatgraph made llstatgraph use param blocks more effectively moves initial set of stats over to lltrace removed windows.h #defines for min and max --- indra/llui/llstatgraph.h | 99 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 87 insertions(+), 12 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 757525e232..e7de945694 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -30,29 +30,88 @@ #include "llview.h" #include "llframetimer.h" #include "v4color.h" +#include "lltrace.h" class LLStat; class LLStatGraph : public LLView { public: - LLStatGraph(const LLView::Params&); + struct ThresholdParams : public LLInitParam::Block + { + Mandatory value; + Optional color; - virtual void draw(); + ThresholdParams() + : value("value"), + color("color", LLColor4::white) + {} + }; + + struct Thresholds : public LLInitParam::Block + { + Multiple threshold; + + Thresholds() + : threshold("threshold") + {} + }; + + struct StatParams : public LLInitParam::ChoiceBlock + { + Alternative legacy_stat; + Alternative* > f32_stat; + Alternative* > s32_stat; + }; + + struct Params : public LLInitParam::Block + { + Mandatory stat; + Optional label, + units; + Optional precision; + Optional min, + max; + Optional per_sec; + Optional value; + + Optional thresholds; + + Params() + : stat("stat"), + label("label"), + units("units"), + precision("precision", 0), + min("min", 0.f), + max("max", 125.f), + per_sec("per_sec", true), + value("value", 0.f), + thresholds("thresholds") + { + Thresholds _thresholds; + _thresholds.threshold.add(ThresholdParams().value(0.f).color(LLColor4::green)) + .add(ThresholdParams().value(0.33f).color(LLColor4::yellow)) + .add(ThresholdParams().value(0.5f).color(LLColor4::red)) + .add(ThresholdParams().value(0.75f).color(LLColor4::red)); + thresholds = _thresholds; + } + }; + LLStatGraph(const Params&); - void setLabel(const std::string& label); - void setUnits(const std::string& units); - void setPrecision(const S32 precision); - void setStat(LLStat *statp); - void setThreshold(const S32 i, F32 value); void setMin(const F32 min); void setMax(const F32 max); + virtual void draw(); + /*virtual*/ void setValue(const LLSD& value); - LLStat *mStatp; - BOOL mPerSec; private: + LLStat* mStatp; + LLTrace::Stat* mF32Statp; + LLTrace::Stat* mS32Statp; + + BOOL mPerSec; + F32 mValue; F32 mMin; @@ -62,9 +121,25 @@ private: std::string mUnits; S32 mPrecision; // Num of digits of precision after dot - S32 mNumThresholds; - F32 mThresholds[4]; - LLColor4 mThresholdColors[4]; + struct Threshold + { + Threshold(F32 value, const LLUIColor& color) + : mValue(value), + mColor(color) + {} + + F32 mValue; + LLUIColor mColor; + bool operator <(const Threshold& other) + { + return mValue < other.mValue; + } + }; + typedef std::vector threshold_vec_t; + threshold_vec_t mThresholds; + //S32 mNumThresholds; + //F32 mThresholds[4]; + //LLColor4 mThresholdColors[4]; }; #endif // LL_LLSTATGRAPH_H -- cgit v1.2.3 From 14b1b0b2bb6bac5bc688cc4d14c33f1b680dd3b4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Oct 2012 19:39:04 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages cleaned up API samplers are now value types with copy-on-write buffers under the hood removed coupling with LLThread --- indra/llui/llstatgraph.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index e7de945694..69fc36ea52 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -60,8 +60,7 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { Alternative legacy_stat; - Alternative* > f32_stat; - Alternative* > s32_stat; + Alternative* > rate_stat; }; struct Params : public LLInitParam::Block @@ -107,8 +106,8 @@ public: private: LLStat* mStatp; - LLTrace::Stat* mF32Statp; - LLTrace::Stat* mS32Statp; + LLTrace::Rate* mF32Statp; + LLTrace::Rate* mS32Statp; BOOL mPerSec; -- cgit v1.2.3 From 041dfccd1ea5b59c1b3c4e37e9a5495cad342c8f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Oct 2012 20:17:52 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system default to double precision now fixed unit conversion logic for LLUnit renamed LLTrace::Rate to LLTrace::Count and got rid of the old count as it was confusing some const correctness changes --- indra/llui/llstatgraph.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 69fc36ea52..54a959f49e 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -60,7 +60,7 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { Alternative legacy_stat; - Alternative* > rate_stat; + Alternative* > rate_stat; }; struct Params : public LLInitParam::Block @@ -106,8 +106,7 @@ public: private: LLStat* mStatp; - LLTrace::Rate* mF32Statp; - LLTrace::Rate* mS32Statp; + LLTrace::Count<>* mNewStatp; BOOL mPerSec; -- cgit v1.2.3 From 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Oct 2012 19:43:35 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system converted all remaining LLViewerStats to lltrace --- indra/llui/llstatgraph.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 54a959f49e..5bbd9e9d24 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -60,7 +60,8 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { Alternative legacy_stat; - Alternative* > rate_stat; + Alternative* > count_stat; + Alternative* > measurement_stat; }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From a52d203a4f1d2988e8ffba16258f3f132f22f56d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 17 Oct 2012 20:00:07 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system started conversion of llviewerassetstats removed old, dead LLViewerStats code made units tracing require units declaration clean up of units handling --- indra/llui/llstatgraph.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 5bbd9e9d24..b20966d608 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -59,9 +59,9 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative legacy_stat; - Alternative* > count_stat; - Alternative* > measurement_stat; + Alternative legacy_stat; + Alternative count_stat; + Alternative measurement_stat; }; struct Params : public LLInitParam::Block @@ -106,8 +106,8 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLStat* mStatp; - LLTrace::Count<>* mNewStatp; + LLStat* mStatp; + LLTrace::count_common_t* mNewStatp; BOOL mPerSec; -- cgit v1.2.3 From 819adb5eb4d7f982121f3dbd82750e05d26864d9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 00:26:44 -0700 Subject: SH-3405 FIX convert existing stats to lltrace system final removal of remaining LLStat code --- indra/llui/llstatgraph.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index b20966d608..f33c784262 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -32,8 +32,6 @@ #include "v4color.h" #include "lltrace.h" -class LLStat; - class LLStatGraph : public LLView { public: @@ -59,9 +57,10 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative legacy_stat; - Alternative count_stat; - Alternative measurement_stat; + Alternative count_stat_float; + Alternative count_stat_int; + Alternative measurement_stat_float; + Alternative measurement_stat_int; }; struct Params : public LLInitParam::Block @@ -106,8 +105,8 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLStat* mStatp; - LLTrace::count_common_t* mNewStatp; + LLTrace::count_common_float_t* mNewStatFloatp; + LLTrace::count_common_int_t* mNewStatIntp; BOOL mPerSec; -- cgit v1.2.3 From 67ec47e6da389661934ed2ddfa55ca58455fa7e5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 13 Nov 2012 17:10:10 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system moving fast timers into lltrace namespace and accumulation system --- indra/llui/llstatgraph.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index f33c784262..09b34c2358 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,10 +57,10 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative count_stat_float; - Alternative count_stat_int; - Alternative measurement_stat_float; - Alternative measurement_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; + Alternative >* > measurement_stat_float; + Alternative >* > measurement_stat_int; }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From 9d77e030d9a0d23cebce616631677459eec1612c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Nov 2012 23:52:27 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system cleaning up build moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc streamlined Time class and consolidated functionality in BlockTimer class llfasttimer is no longer included via llstring.h, so had to add it manually in several places --- indra/llui/llstatgraph.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 09b34c2358..57856ff6f2 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,10 +57,10 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; - Alternative >* > measurement_stat_float; - Alternative >* > measurement_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; + Alternative >* > measurement_stat_float; + Alternative >* > measurement_stat_int; }; struct Params : public LLInitParam::Block @@ -105,8 +105,8 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLTrace::count_common_float_t* mNewStatFloatp; - LLTrace::count_common_int_t* mNewStatIntp; + LLTrace::TraceType >* mNewStatFloatp; + LLTrace::TraceType >* mNewStatIntp; BOOL mPerSec; -- cgit v1.2.3 From 7b4d27ecbcb5ac702459be97cbf6b81354850658 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 14 Mar 2013 19:36:50 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics collapsed Orientation enums to all use LLView::EOrientation added ability to display stat bar horizontally --- indra/llui/llstatgraph.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 57856ff6f2..c9e33ed902 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,8 +57,8 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; Alternative >* > measurement_stat_float; Alternative >* > measurement_stat_int; }; -- cgit v1.2.3 From 9ae76d12157641033431381959ef4f798a119b8d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 29 May 2013 17:00:50 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed copy construction behavior of Recordings to not zero out data split measurement into event and sample, with sample representing a continuous function --- indra/llui/llstatgraph.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index c9e33ed902..08681b3704 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,10 +57,12 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; - Alternative >* > measurement_stat_float; - Alternative >* > measurement_stat_int; + Alternative >* > count_stat_float; + Alternative >* > count_stat_int; + Alternative >* > event_stat_float; + Alternative >* > event_stat_int; + Alternative >* > sample_stat_float; + Alternative >* > sample_stat_int; }; struct Params : public LLInitParam::Block -- cgit v1.2.3 From 233201f8227f92e93061d3e2393a17b42dfa3dd1 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 2 Jun 2013 22:49:17 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed unnecessary templates from accumulator types...now always track data in double precision floating point, using templated accessors to convert to and from arbitrary types --- indra/llui/llstatgraph.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 08681b3704..38fe12d18b 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,12 +57,9 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative >* > count_stat_float; - Alternative >* > count_stat_int; - Alternative >* > event_stat_float; - Alternative >* > event_stat_int; - Alternative >* > sample_stat_float; - Alternative >* > sample_stat_int; + Alternative* > count_stat_float; + Alternative* > event_stat_float; + Alternative* > sample_stat_float; }; struct Params : public LLInitParam::Block @@ -107,8 +104,7 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLTrace::TraceType >* mNewStatFloatp; - LLTrace::TraceType >* mNewStatIntp; + LLTrace::TraceType* mNewStatFloatp; BOOL mPerSec; -- cgit v1.2.3 From 17df8988fec3f2ba991ca9e34ff8148253a2fc04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 7 Oct 2013 13:38:03 -0700 Subject: renamed TraceType to StatType added more MemTrackable types optimized memory usage of LLTrace some more --- indra/llui/llstatgraph.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/llstatgraph.h') diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index 38fe12d18b..f381e92a4d 100755 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -57,9 +57,9 @@ public: struct StatParams : public LLInitParam::ChoiceBlock { - Alternative* > count_stat_float; - Alternative* > event_stat_float; - Alternative* > sample_stat_float; + Alternative* > count_stat_float; + Alternative* > event_stat_float; + Alternative* > sample_stat_float; }; struct Params : public LLInitParam::Block @@ -104,7 +104,7 @@ public: /*virtual*/ void setValue(const LLSD& value); private: - LLTrace::TraceType* mNewStatFloatp; + LLTrace::StatType* mNewStatFloatp; BOOL mPerSec; -- cgit v1.2.3