1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
From: Mathias Gibbens <gibmat@debian.org>
Date: Mon, 18 Aug 2025 13:40:07 +0200
Subject: Fix atomic alignment on 32bit systems
Forwarded: https://github.com/uber-go/tally/issues/223
---
m3/reporter.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/m3/reporter.go b/m3/reporter.go
index 32c0d42..851c657 100644
--- a/m3/reporter.go
+++ b/m3/reporter.go
@@ -105,6 +105,12 @@ type Reporter interface {
// remote M3 collector, metrics are batched together and emitted
// via either thrift compact or binary protocol in batch UDP packets.
type reporter struct {
+ now atomic.Int64
+ pending atomic.Uint64
+ numBatches atomic.Int64
+ numMetrics atomic.Int64
+ numWriteErrors atomic.Int64
+ done atomic.Bool
bucketIDTagName string
bucketTagName string
bucketValFmt string
@@ -114,24 +120,18 @@ type reporter struct {
calcProto thrift.TProtocol
client *m3thrift.M3Client
commonTags []m3thrift.MetricTag
- done atomic.Bool
donech chan struct{}
freeBytes int32
metCh chan sizedMetric
- now atomic.Int64
overheadBytes int32
- pending atomic.Uint64
resourcePool *resourcePool
stringInterner *cache.StringInterner
tagCache *cache.TagCache
wg sync.WaitGroup
batchSizeHistogram tally.CachedHistogram
- numBatches atomic.Int64
numBatchesCounter tally.CachedCount
- numMetrics atomic.Int64
numMetricsCounter tally.CachedCount
- numWriteErrors atomic.Int64
numWriteErrorsCounter tally.CachedCount
numTagCacheCounter tally.CachedCount
}
|