github.com/uber-go/tally/v4@v4.1.17/m3/thrift/thrift.diff (about) 1 diff --git a/m3/thrift/v2/m3.go b/m3/thrift/v2/m3.go 2 index fc46a31..f0a288c 100644 3 --- a/m3/thrift/v2/m3.go 4 +++ b/m3/thrift/v2/m3.go 5 @@ -17,7 +17,7 @@ var _ = bytes.Equal 6 type M3 interface { 7 // Parameters: 8 // - Batch 9 - EmitMetricBatchV2(batch *MetricBatch) (err error) 10 + EmitMetricBatchV2(batch MetricBatch) (err error) 11 } 12 13 type M3Client struct { 14 @@ -48,14 +48,14 @@ func NewM3ClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thri 15 16 // Parameters: 17 // - Batch 18 -func (p *M3Client) EmitMetricBatchV2(batch *MetricBatch) (err error) { 19 +func (p *M3Client) EmitMetricBatchV2(batch MetricBatch) (err error) { 20 if err = p.sendEmitMetricBatchV2(batch); err != nil { 21 return 22 } 23 return 24 } 25 26 -func (p *M3Client) sendEmitMetricBatchV2(batch *MetricBatch) (err error) { 27 +func (p *M3Client) sendEmitMetricBatchV2(batch MetricBatch) (err error) { 28 oprot := p.OutputProtocol 29 if oprot == nil { 30 oprot = p.ProtocolFactory.GetProtocol(p.Transport) 31 @@ -145,23 +145,23 @@ func (p *m3ProcessorEmitMetricBatchV2) Process(seqId int32, iprot, oprot thrift.TP 32 // Attributes: 33 // - Batch 34 type M3EmitMetricBatchV2Args struct { 35 - Batch *MetricBatch `thrift:"batch,1" json:"batch"` 36 + Batch MetricBatch `thrift:"batch,1" json:"batch"` 37 } 38 39 func NewM3EmitMetricBatchV2Args() *M3EmitMetricBatchV2Args { 40 return &M3EmitMetricBatchV2Args{} 41 } 42 43 -var M3EmitMetricBatchV2Args_Batch_DEFAULT *MetricBatch 44 +var M3EmitMetricBatchV2Args_Batch_DEFAULT MetricBatch 45 46 -func (p *M3EmitMetricBatchV2Args) GetBatch() *MetricBatch { 47 +func (p *M3EmitMetricBatchV2Args) GetBatch() MetricBatch { 48 if !p.IsSetBatch() { 49 return M3EmitMetricBatchV2Args_Batch_DEFAULT 50 } 51 return p.Batch 52 } 53 func (p *M3EmitMetricBatchV2Args) IsSetBatch() bool { 54 - return p.Batch != nil 55 + return p.Batch.Metrics != nil || p.Batch.CommonTags != nil 56 } 57 58 func (p *M3EmitMetricBatchV2Args) Read(iprot thrift.TProtocol) error { 59 @@ -198,7 +198,7 @@ func (p *M3EmitMetricBatchV2Args) Read(iprot thrift.TProtocol) error { 60 } 61 62 func (p *M3EmitMetricBatchV2Args) readField1(iprot thrift.TProtocol) error { 63 - p.Batch = &MetricBatch{} 64 + p.Batch = MetricBatch{} 65 if err := p.Batch.Read(iprot); err != nil { 66 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Batch), err) 67 } 68 diff --git a/m3/thrift/v2/ttypes.go b/m3/thrift/v2/ttypes.go 69 index 5f83caa..3e6c33b 100644 70 --- a/m3/thrift/v2/ttypes.go 71 +++ b/m3/thrift/v2/ttypes.go 72 @@ -429,10 +429,10 @@ func (p *MetricTag) String() string { 73 // - Timestamp 74 // - Tags 75 type Metric struct { 76 - Name string `thrift:"name,1,required" json:"name"` 77 - Value *MetricValue `thrift:"value,2,required" json:"value"` 78 - Timestamp int64 `thrift:"timestamp,3,required" json:"timestamp"` 79 - Tags []*MetricTag `thrift:"tags,4" json:"tags,omitempty"` 80 + Name string `thrift:"name,1,required" json:"name"` 81 + Value MetricValue `thrift:"value,2,required" json:"value"` 82 + Timestamp int64 `thrift:"timestamp,3,required" json:"timestamp"` 83 + Tags []MetricTag `thrift:"tags,4" json:"tags,omitempty"` 84 } 85 86 func NewMetric() *Metric { 87 @@ -443,9 +443,9 @@ func (p *Metric) GetName() string { 88 return p.Name 89 } 90 91 -var Metric_Value_DEFAULT *MetricValue 92 +var Metric_Value_DEFAULT MetricValue 93 94 -func (p *Metric) GetValue() *MetricValue { 95 +func (p *Metric) GetValue() MetricValue { 96 if !p.IsSetValue() { 97 return Metric_Value_DEFAULT 98 } 99 @@ -456,13 +456,13 @@ func (p *Metric) GetTimestamp() int64 { 100 return p.Timestamp 101 } 102 103 -var Metric_Tags_DEFAULT []*MetricTag 104 +var Metric_Tags_DEFAULT []MetricTag 105 106 -func (p *Metric) GetTags() []*MetricTag { 107 +func (p *Metric) GetTags() []MetricTag { 108 return p.Tags 109 } 110 func (p *Metric) IsSetValue() bool { 111 - return p.Value != nil 112 + return p.Value.GetMetricType() != MetricType_INVALID || p.Value.Count != 0 || p.Value.Gauge != 0 || p.Value.Timer != 0 113 } 114 115 func (p *Metric) IsSetTags() bool { 116 @@ -540,7 +540,7 @@ func (p *Metric) readField1(iprot thrift.TProtocol) error { 117 } 118 119 func (p *Metric) readField2(iprot thrift.TProtocol) error { 120 - p.Value = &MetricValue{} 121 + p.Value = MetricValue{} 122 if err := p.Value.Read(iprot); err != nil { 123 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) 124 } 125 @@ -561,10 +561,10 @@ func (p *Metric) readField4(iprot thrift.TProtocol) error { 126 if err != nil { 127 return thrift.PrependError("error reading list begin: ", err) 128 } 129 - tSlice := make([]*MetricTag, 0, size) 130 + tSlice := make([]MetricTag, 0, size) 131 p.Tags = tSlice 132 for i := 0; i < size; i++ { 133 - _elem0 := &MetricTag{} 134 + _elem0 := MetricTag{} 135 if err := _elem0.Read(iprot); err != nil { 136 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) 137 } 138 @@ -674,21 +674,21 @@ func (p *Metric) String() string { 139 // - Metrics 140 // - CommonTags 141 type MetricBatch struct { 142 - Metrics []*Metric `thrift:"metrics,1,required" json:"metrics"` 143 - CommonTags []*MetricTag `thrift:"commonTags,2" json:"commonTags,omitempty"` 144 + Metrics []Metric `thrift:"metrics,1,required" json:"metrics"` 145 + CommonTags []MetricTag `thrift:"commonTags,2" json:"commonTags,omitempty"` 146 } 147 148 func NewMetricBatch() *MetricBatch { 149 return &MetricBatch{} 150 } 151 152 -func (p *MetricBatch) GetMetrics() []*Metric { 153 +func (p *MetricBatch) GetMetrics() []Metric { 154 return p.Metrics 155 } 156 157 -var MetricBatch_CommonTags_DEFAULT []*MetricTag 158 +var MetricBatch_CommonTags_DEFAULT []MetricTag 159 160 -func (p *MetricBatch) GetCommonTags() []*MetricTag { 161 +func (p *MetricBatch) GetCommonTags() []MetricTag { 162 return p.CommonTags 163 } 164 func (p *MetricBatch) IsSetCommonTags() bool { 165 @@ -743,10 +743,10 @@ func (p *MetricBatch) readField1(iprot thrift.TProtocol) error { 166 if err != nil { 167 return thrift.PrependError("error reading list begin: ", err) 168 } 169 - tSlice := make([]*Metric, 0, size) 170 + tSlice := make([]Metric, 0, size) 171 p.Metrics = tSlice 172 for i := 0; i < size; i++ { 173 - _elem1 := &Metric{} 174 + _elem1 := Metric{} 175 if err := _elem1.Read(iprot); err != nil { 176 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) 177 } 178 @@ -763,10 +763,10 @@ func (p *MetricBatch) readField2(iprot thrift.TProtocol) error { 179 if err != nil { 180 return thrift.PrependError("error reading list begin: ", err) 181 } 182 - tSlice := make([]*MetricTag, 0, size) 183 + tSlice := make([]MetricTag, 0, size) 184 p.CommonTags = tSlice 185 for i := 0; i < size; i++ { 186 - _elem2 := &MetricTag{} 187 + _elem2 := MetricTag{} 188 if err := _elem2.Read(iprot); err != nil { 189 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) 190 }