From cfa9c781000a7af6ed419cb7b3b3ea78f1933cfe Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 13 May 2009 07:18:02 -0700 Subject: stats: fancy is a bad name --- src/base/stats/info.hh | 6 ++++-- src/base/stats/mysql.cc | 6 +++--- src/base/stats/text.cc | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/base/stats') diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh index e56445f94..85a0df447 100644 --- a/src/base/stats/info.hh +++ b/src/base/stats/info.hh @@ -180,9 +180,11 @@ struct DistData Counter samples; }; +enum DistType { Deviation, Dist }; + struct DistParams : public StorageParams { - const bool fancy; + const DistType type; /** The minimum value to track. */ Counter min; @@ -193,7 +195,7 @@ struct DistParams : public StorageParams /** The number of buckets. Equal to (max-min)/bucket_size. */ size_type buckets; - explicit DistParams(bool f) : fancy(f) {} + explicit DistParams(DistType t) : type(t) {} }; class DistInfo : public Info diff --git a/src/base/stats/mysql.cc b/src/base/stats/mysql.cc index 605075009..d14904fb0 100644 --- a/src/base/stats/mysql.cc +++ b/src/base/stats/mysql.cc @@ -585,7 +585,7 @@ MySql::configure(const DistInfo &info) const DistParams *params = safe_cast(info.storageParams); - if (!params->fancy) { + if (params->type == Dist) { stat.size = params->buckets; stat.min = params->min; stat.max = params->max; @@ -602,7 +602,7 @@ MySql::configure(const VectorDistInfo &info) const DistParams *params = safe_cast(info.storageParams); - if (!params->fancy) { + if (params->type == Dist) { stat.size = params->buckets; stat.min = params->min; stat.max = params->max; @@ -789,7 +789,7 @@ MySql::output(const DistData &data, const DistParams *params) newdata.data = data.samples; newdata.insert(); - if (data.samples && !params->fancy) { + if (data.samples && params->type == Dist) { newdata.x = db_min_val; newdata.data = data.min_val; newdata.insert(); diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index 599653244..10983506f 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -310,7 +310,7 @@ struct DistPrint Counter max; Counter bucket_size; size_type size; - bool fancy; + DistType type; const DistData &data; @@ -347,7 +347,7 @@ DistPrint::init(const Text *text, const Info &info, const DistParams *params) precision = info.precision; descriptions = text->descriptions; - fancy = params->fancy; + type = params->type; min = params->min; max = params->max; bucket_size = params->bucket_size; @@ -383,7 +383,7 @@ DistPrint::operator()(ostream &stream) const print.value = stdev; print(stream); - if (fancy) + if (type == Deviation) return; assert(size == data.cvec.size()); -- cgit v1.2.3