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
Copy file name to clipboardExpand all lines: docs/en/changes/changes.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@
39
39
* Fix: remove `VirtualServiceAnalysisListener`'s dependency on `GenAIAnalyzerModule` if it is disabled.
40
40
* MAL: register `TimeUnit` in `MALCodegenHelper.ENUM_FQCN` so rule YAML can write `.histogram("le", TimeUnit.MILLISECONDS)` for SDKs that emit histogram bucket bounds in ms (default `SECONDS` unit applies a ×1000 rescale that would otherwise inflate stored `le` labels 1000×).
41
41
* Fix: potential unexpected current directory inclusion in Docker OAP classpath.
42
+
* MAL: add `safeDiv(divisor)` on `SampleFamily` that yields `0` when the divisor is `0` instead of `Infinity`/`NaN`. Replace `/` with `safeDiv(...)` in Envoy AI Gateway latency-average rules so `sum / count * 1000` no longer produces dropped or out-of-range samples when a counter is zero in a window.
43
+
* Fix: `envoy-ai-gateway` metrics rules, make the metrics value return `0` when the divisor is `0`.
42
44
43
45
#### UI
44
46
* Add mobile menu icon and i18n labels for the iOS layer.
Copy file name to clipboardExpand all lines: oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/v2/dsl/SampleFamily.java
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -229,6 +229,31 @@ public SampleFamily div(SampleFamily another) {
229
229
returnnewValue(another, (a, b) -> a / b);
230
230
}
231
231
232
+
/**
233
+
* Safe variant of {@link #div(Number)}: when the divisor is zero, the
234
+
* resulting samples are valued {@code 0.0} instead of {@code NaN}/{@code Infinity}.
235
+
*/
236
+
publicSampleFamilysafeDiv(Numbernumber) {
237
+
finaldoubledivisor = number.doubleValue();
238
+
if (divisor == 0.0) {
239
+
returnnewValue(v -> 0.0);
240
+
}
241
+
returnnewValue(v -> v / divisor);
242
+
}
243
+
244
+
/**
245
+
* Safe variant of {@link #div(SampleFamily)}: for each label-matched pair,
246
+
* yields {@code 0.0} when the right-hand value is zero. When the divisor
247
+
* family is {@link #EMPTY}, the result is also {@link #EMPTY} (no samples
248
+
* to evaluate against), instead of producing {@code NaN}/{@code Infinity}.
249
+
*/
250
+
publicSampleFamilysafeDiv(SampleFamilyanother) {
251
+
if (this == EMPTY || another == EMPTY) {
252
+
returnSampleFamily.EMPTY;
253
+
}
254
+
returnnewValue(another, (a, b) -> b == 0.0 ? 0.0 : a / b);
Copy file name to clipboardExpand all lines: oap-server/analyzer/meter-analyzer/src/test/java/org/apache/skywalking/oap/meter/analyzer/v2/compiler/MALClassGeneratorTest.java
Copy file name to clipboardExpand all lines: oap-server/analyzer/meter-analyzer/src/test/java/org/apache/skywalking/oap/meter/analyzer/v2/dsl/DSLV2Test.java
0 commit comments