mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 14:09:41 -08:00
Ensure ewma int64s are always aligned. (#2675)
This commit is contained in:
parent
363554f675
commit
e9787382b4
|
@ -29,8 +29,10 @@ type ewmaRate struct {
|
||||||
mutex sync.Mutex
|
mutex sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func newEWMARate(alpha float64, interval time.Duration) ewmaRate {
|
// newEWMARate always allocates a new ewmaRate, as this guarantees the atomically
|
||||||
return ewmaRate{
|
// accessed int64 will be aligned on ARM. See prometheus#2666.
|
||||||
|
func newEWMARate(alpha float64, interval time.Duration) *ewmaRate {
|
||||||
|
return &ewmaRate{
|
||||||
alpha: alpha,
|
alpha: alpha,
|
||||||
interval: interval,
|
interval: interval,
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,7 +185,7 @@ type QueueManager struct {
|
||||||
quit chan struct{}
|
quit chan struct{}
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
|
|
||||||
samplesIn, samplesOut, samplesOutDuration ewmaRate
|
samplesIn, samplesOut, samplesOutDuration *ewmaRate
|
||||||
integralAccumulator float64
|
integralAccumulator float64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue