func (e *SimpleEWMA) Add(value float64) {
	if e.value == 0 {  
		e.value = value
	} else {
		e.value = (value * DECAY) + (e.value * (1 - DECAY))
	}
}
Add adds a value to the series and updates the moving average.
package ewma
const (
	AVG_METRIC_AGE float64 = 30.0
	DECAY float64 = 2 / (float64(AVG_METRIC_AGE) + 1)
	WARMUP_SAMPLES uint8 = 10
)
type MovingAverage interface {
	Add(float64)
	Value() float64
	Set(float64)
}
func NewMovingAverage(age ...float64) MovingAverage {
	if len(age) == 0 || age[0] == AVG_METRIC_AGE {
		return new(SimpleEWMA)
	}
	return &VariableEWMA{
		decay: 2 / (age[0] + 1),
	}
}
type SimpleEWMA struct {
	value float64
}