Skip to content

Commit 22407fc

Browse files
committed
fix(metrics): 64bit aligns standardcounter
Due to a bug in golang the 64bit variable i need to come first to be 64bit aligned. https://golang.org/pkg/sync/atomic/#pkg-note-BUG closes grafana#5341
1 parent dba6fe8 commit 22407fc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/metrics/counter.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ func RegCounter(name string, tagStrings ...string) Counter {
2929
// StandardCounter is the standard implementation of a Counter and uses the
3030
// sync/atomic package to manage a single int64 value.
3131
type StandardCounter struct {
32+
count int64 //Due to a bug in golang the 64bit variable need to come first to be 64bit aligned. https://golang.org/pkg/sync/atomic/#pkg-note-BUG
3233
*MetricMeta
33-
34-
count int64
3534
}
3635

3736
// Clear sets the counter to zero.

0 commit comments

Comments
 (0)