Print the half-life in Formatter output as it is human understandable
and the value used when configuring the counters.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
{
decay();
f->dump_float("value", val);
- f->dump_float("halflife", rate.k);
+ f->dump_float("halflife", rate.get_halflife());
}
void DecayCounter::generate_test_instances(std::list<DecayCounter*>& ls)
void set_halflife(double hl) {
k = log(.5) / hl;
}
+ double get_halflife() const {
+ return log(.5) / k;
+ }
private:
double k = 0; // k = ln(.5)/half_life