summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltrace.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-06-17 01:18:21 -0700
committerRichard Linden <none@none>2013-06-17 01:18:21 -0700
commit3f2de87340b1c831ea59e4a3ca960d49f343c9fd (patch)
tree1663517a0e50fbd9f736b29603bbd957d38967eb /indra/llcommon/lltrace.h
parent9fd3af3c389ed491b515cbb5136b344b069913e4 (diff)
SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
added getAs and setAs to LLUnit to make it clearer how you specify units removed accidental 0-based indexing of periodicRecording history... should now be consistently 1-based, with 0 accessing current active recording removed per frame timer updates of all historical timer bars in fast timer display added missing assignment operator to recordings
Diffstat (limited to 'indra/llcommon/lltrace.h')
-rw-r--r--indra/llcommon/lltrace.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h
index 1bf853c5c0..cd377531e8 100644
--- a/indra/llcommon/lltrace.h
+++ b/indra/llcommon/lltrace.h
@@ -66,6 +66,16 @@ typedef LLUnit<F64, LLUnits::Kilometers> Kilometers;
typedef LLUnit<F64, LLUnits::Centimeters> Centimeters;
typedef LLUnit<F64, LLUnits::Millimeters> Millimeters;
+
+template<typename T>
+T storage_value(T val) { return val; }
+
+template<typename UNIT_TYPE, typename STORAGE_TYPE>
+STORAGE_TYPE storage_value(LLUnit<STORAGE_TYPE, UNIT_TYPE> val) { return val.value(); }
+
+template<typename UNIT_TYPE, typename STORAGE_TYPE>
+STORAGE_TYPE storage_value(LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE> val) { return val.value(); }
+
void init();
void cleanup();
bool isInitialized();
@@ -678,7 +688,7 @@ template<typename T, typename VALUE_T>
void record(EventStatHandle<T>& measurement, VALUE_T value)
{
T converted_value(value);
- measurement.getPrimaryAccumulator()->record(LLUnits::storageValue(converted_value));
+ measurement.getPrimaryAccumulator()->record(storage_value(converted_value));
}
template <typename T = F64>
@@ -700,7 +710,7 @@ template<typename T, typename VALUE_T>
void sample(SampleStatHandle<T>& measurement, VALUE_T value)
{
T converted_value(value);
- measurement.getPrimaryAccumulator()->sample(LLUnits::storageValue(converted_value));
+ measurement.getPrimaryAccumulator()->sample(storage_value(converted_value));
}
template <typename T = F64>
@@ -722,7 +732,7 @@ template<typename T, typename VALUE_T>
void add(CountStatHandle<T>& count, VALUE_T value)
{
T converted_value(value);
- count.getPrimaryAccumulator()->add(LLUnits::storageValue(converted_value));
+ count.getPrimaryAccumulator()->add(storage_value(converted_value));
}