summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltraceaccumulators.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-10-03 19:04:51 -0700
committerRichard Linden <none@none>2013-10-03 19:04:51 -0700
commitf8a85003ddd4bee1ae00fc329c1c1d66d6100cbd (patch)
tree2e375eabfc5dcba0155a8201e3a356dd4a18580e /indra/llcommon/lltraceaccumulators.h
parent1821fa12838974c4eb7de2b6e9f79bf8a4cf23f1 (diff)
more memory optimizations of lltrace
Diffstat (limited to 'indra/llcommon/lltraceaccumulators.h')
-rw-r--r--indra/llcommon/lltraceaccumulators.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index d03c6ce5c0..27c0910665 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -266,8 +266,8 @@ namespace LLTrace
void sync(F64SecondsImplicit) {}
F64 getSum() const { return mSum; }
- F64 getMin() const { return mMin; }
- F64 getMax() const { return mMax; }
+ F32 getMin() const { return mMin; }
+ F32 getMax() const { return mMax; }
F64 getLastValue() const { return mLastValue; }
F64 getMean() const { return mMean; }
F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); }
@@ -277,13 +277,14 @@ namespace LLTrace
private:
F64 mSum,
- mMin,
- mMax,
mLastValue;
F64 mMean,
mSumOfSquares;
+ F32 mMin,
+ mMax;
+
S32 mNumSamples;
};
@@ -350,8 +351,8 @@ namespace LLTrace
}
F64 getSum() const { return mSum; }
- F64 getMin() const { return mMin; }
- F64 getMax() const { return mMax; }
+ F32 getMin() const { return mMin; }
+ F32 getMax() const { return mMax; }
F64 getLastValue() const { return mLastValue; }
F64 getMean() const { return mMean; }
F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); }
@@ -362,12 +363,8 @@ namespace LLTrace
private:
F64 mSum,
- mMin,
- mMax,
mLastValue;
- bool mHasValue; // distinct from mNumSamples, since we might have inherited an old sample
-
F64 mMean,
mSumOfSquares;
@@ -375,7 +372,13 @@ namespace LLTrace
mLastSampleTimeStamp,
mTotalSamplingTime;
+ F32 mMin,
+ mMax;
+
S32 mNumSamples;
+ // distinct from mNumSamples, since we might have inherited a last value from
+ // a previous sampling period
+ bool mHasValue;
};
class CountAccumulator
@@ -505,8 +508,8 @@ namespace LLTrace
void addSamples(const MemStatAccumulator& other, EBufferAppendType append_type)
{
- mFootprintAllocations.addSamples(other.mFootprintAllocations, append_type);
- mFootprintDeallocations.addSamples(other.mFootprintDeallocations, append_type);
+ mAllocations.addSamples(other.mAllocations, append_type);
+ mDeallocations.addSamples(other.mDeallocations, append_type);
if (append_type == SEQUENTIAL)
{
@@ -514,7 +517,7 @@ namespace LLTrace
}
else
{
- F64 allocation_delta(other.mFootprintAllocations.getSum() - other.mFootprintDeallocations.getSum());
+ F64 allocation_delta(other.mAllocations.getSum() - other.mDeallocations.getSum());
mSize.sample(mSize.hasValue()
? mSize.getLastValue() + allocation_delta
: allocation_delta);
@@ -524,8 +527,8 @@ namespace LLTrace
void reset(const MemStatAccumulator* other)
{
mSize.reset(other ? &other->mSize : NULL);
- mFootprintAllocations.reset(other ? &other->mFootprintAllocations : NULL);
- mFootprintDeallocations.reset(other ? &other->mFootprintDeallocations : NULL);
+ mAllocations.reset(other ? &other->mAllocations : NULL);
+ mDeallocations.reset(other ? &other->mDeallocations : NULL);
}
void sync(F64SecondsImplicit time_stamp)
@@ -534,13 +537,14 @@ namespace LLTrace
}
SampleAccumulator mSize;
- EventAccumulator mFootprintAllocations;
- CountAccumulator mFootprintDeallocations;
+ EventAccumulator mAllocations;
+ CountAccumulator mDeallocations;
};
struct AccumulatorBufferGroup : public LLRefCount
{
AccumulatorBufferGroup();
+ AccumulatorBufferGroup(const AccumulatorBufferGroup&);
~AccumulatorBufferGroup();
void handOffTo(AccumulatorBufferGroup& other);