Explorar o código

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 #5341
bergquist %!s(int64=9) %!d(string=hai) anos
pai
achega
22407fc897
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      pkg/metrics/counter.go

+ 1 - 2
pkg/metrics/counter.go

@@ -29,9 +29,8 @@ func RegCounter(name string, tagStrings ...string) Counter {
 // StandardCounter is the standard implementation of a Counter and uses the
 // sync/atomic package to manage a single int64 value.
 type StandardCounter struct {
+	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
 	*MetricMeta
-
-	count int64
 }
 
 // Clear sets the counter to zero.