You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Printf("E! The from distribution is not an exponential histogram distribution. Cannot add distributions: %v", from)
131
+
return
132
+
}
133
+
111
134
iffrom.SampleCount() <=0 {
112
135
log.Printf("D! SampleCount should be larger than 0: %v", from.SampleCount())
113
136
return
114
137
}
115
138
116
139
// some scales are compatible due to perfect subsetting (buckets of an exponential histogram map exactly into
117
140
// buckets with a lesser scale). for simplicity, deny adding distributions if the scales dont match
118
-
iffrom.scale!=d.scale {
119
-
log.Printf("E! The from distribution scale is not compatible with the to distribution scale: from distribution scale %v, to distribution scale %v", from.scale, d.scale)
141
+
ifexpFrom.scale!=d.scale {
142
+
log.Printf("E! The from distribution scale is not compatible with the to distribution scale: from distribution scale %v, to distribution scale %v", expFrom.scale, d.scale)
120
143
return
121
144
}
122
145
123
-
iffrom.zeroThreshold!=d.zeroThreshold {
124
-
log.Printf("E! The from distribution zeroThreshold is not compatible with the to distribution zeroThreshold: from distribution zeroThreshold %v, to distribution zeroThreshold %v", from.zeroThreshold, d.zeroThreshold)
146
+
ifexpFrom.zeroThreshold!=d.zeroThreshold {
147
+
log.Printf("E! The from distribution zeroThreshold is not compatible with the to distribution zeroThreshold: from distribution zeroThreshold %v, to distribution zeroThreshold %v", expFrom.zeroThreshold, d.zeroThreshold)
125
148
return
126
149
}
127
150
128
-
d.max=max(d.max, from.Maximum())
129
-
d.min=min(d.min, from.Minimum())
130
-
d.sampleCount+=from.SampleCount()
131
-
d.sum+=from.Sum()
151
+
d.max=max(d.max, expFrom.Maximum())
152
+
d.min=min(d.min, expFrom.Minimum())
153
+
d.sampleCount+=expFrom.SampleCount()
154
+
d.sum+=expFrom.Sum()
132
155
133
-
fori:=rangefrom.positiveBuckets {
134
-
d.positiveBuckets[i] +=from.positiveBuckets[i]
156
+
fori:=rangeexpFrom.positiveBuckets {
157
+
d.positiveBuckets[i] +=expFrom.positiveBuckets[i]
135
158
}
136
159
137
-
d.zeroCount+=from.zeroCount
160
+
d.zeroCount+=expFrom.zeroCount
138
161
139
-
fori:=rangefrom.negativeBuckets {
140
-
d.negativeBuckets[i] +=from.negativeBuckets[i]
162
+
fori:=rangeexpFrom.negativeBuckets {
163
+
d.negativeBuckets[i] +=expFrom.negativeBuckets[i]
141
164
}
142
165
143
166
ifd.unit=="" {
144
-
d.unit=from.Unit()
145
-
} elseifd.unit!=from.Unit() &&from.Unit() !="" {
146
-
log.Printf("D! Multiple units are detected: %s, %s", d.unit, from.Unit())
0 commit comments