gauge: fix unaligned 64-bit atomic operation
panic on 32-bit architectures
This commit is contained in:
parent
fa3e54236d
commit
49f6df7219
6
gauge.go
6
gauge.go
@ -28,11 +28,11 @@ func NewGauge(name string, f func() float64) *Gauge {
|
|||||||
|
|
||||||
// Gauge is a float64 gauge.
|
// Gauge is a float64 gauge.
|
||||||
type Gauge struct {
|
type Gauge struct {
|
||||||
// f is a callback, which is called for returning the gauge value.
|
|
||||||
f func() float64
|
|
||||||
|
|
||||||
// valueBits contains uint64 representation of float64 passed to Gauge.Set.
|
// valueBits contains uint64 representation of float64 passed to Gauge.Set.
|
||||||
valueBits uint64
|
valueBits uint64
|
||||||
|
|
||||||
|
// f is a callback, which is called for returning the gauge value.
|
||||||
|
f func() float64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get returns the current value for g.
|
// Get returns the current value for g.
|
||||||
|
Loading…
Reference in New Issue
Block a user