summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltraceaccumulators.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-10-17 19:18:53 -0700
committerRichard Linden <none@none>2013-10-17 19:18:53 -0700
commit18aedf0241ba893e12140c0a3855f328d2b4eded (patch)
tree11d95ba4f7578d52e8ab69b35b181f956f4a8590 /indra/llcommon/lltraceaccumulators.h
parentec178690240a56ffa43b8f37c6b581c9008d3d7d (diff)
fix for assert at runtime (reading stats from recording while it was active)
fix for bad values returns from getPeriodMin and getPeriodMax on count stats when no counts recorded fix for gcc compile time error (typename ftw)
Diffstat (limited to 'indra/llcommon/lltraceaccumulators.h')
-rw-r--r--indra/llcommon/lltraceaccumulators.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index c30cc9a107..2971907849 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -226,6 +226,7 @@ namespace LLTrace
{
public:
typedef F64 value_t;
+ static F64 getDefaultValue() { return NaN; }
EventAccumulator()
: mSum(0),
@@ -293,6 +294,7 @@ namespace LLTrace
{
public:
typedef F64 value_t;
+ static F64 getDefaultValue() { return NaN; }
SampleAccumulator()
: mSum(0),
@@ -385,6 +387,7 @@ namespace LLTrace
{
public:
typedef F64 value_t;
+ static F64 getDefaultValue() { return 0; }
CountAccumulator()
: mSum(0),
@@ -415,6 +418,8 @@ namespace LLTrace
S32 getSampleCount() const { return mNumSamples; }
+ bool hasValue() const { return true; }
+
private:
F64 mSum;
@@ -425,6 +430,8 @@ namespace LLTrace
{
public:
typedef F64Seconds value_t;
+ static F64Seconds getDefaultValue() { return F64Seconds(0); }
+
typedef TimeBlockAccumulator self_t;
// fake classes that allows us to view different facets of underlying statistic
@@ -453,6 +460,7 @@ namespace LLTrace
void addSamples(const self_t& other, EBufferAppendType append_type);
void reset(const self_t* other);
void sync(F64SecondsImplicit) {}
+ bool hasValue() const { return true; }
//
// members
@@ -493,17 +501,22 @@ namespace LLTrace
struct MemAccumulator
{
+ typedef F64Bytes value_t;
+ static F64Bytes getDefaultValue() { return F64Bytes(0); }
+
typedef MemAccumulator self_t;
// fake classes that allows us to view different facets of underlying statistic
struct AllocationFacet
{
typedef F64Bytes value_t;
+ static F64Bytes getDefaultValue() { return F64Bytes(0); }
};
struct DeallocationFacet
{
typedef F64Bytes value_t;
+ static F64Bytes getDefaultValue() { return F64Bytes(0); }
};
void addSamples(const MemAccumulator& other, EBufferAppendType append_type)
@@ -536,6 +549,8 @@ namespace LLTrace
mSize.sync(time_stamp);
}
+ bool hasValue() const { return mSize.hasValue(); }
+
SampleAccumulator mSize;
EventAccumulator mAllocations;
CountAccumulator mDeallocations;