-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(设备-详细信息-运行状态-详情)增加极差值统计规则 #478
base: master
Are you sure you want to change the base?
Conversation
@@ -205,7 +207,10 @@ public Flux<Map<String, Object>> aggregation(String[] index, AggregationQueryPar | |||
) | |||
) | |||
.flatMap(restClient::searchForPage) | |||
.flatMapMany(this::parseResult) | |||
.flatMapMany(row -> this.parseResult(row, aggregationQueryParam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个映射看上去可以在上面构造聚合参数时一起构造。
}; | ||
}, | ||
|
||
DIFFERENCE("极差值") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RANGE 更合适?
} | ||
switch (agg) { | ||
case DIFFERENCE: | ||
BigDecimal max = (!Double.isInfinite(parsedStats.getMax()) ? BigDecimal.valueOf(parsedStats.getMax()) : BigDecimal.ZERO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
处理null的情况, max或者min为Infinite时,应该返回 null才对?(表示没有数据)。而0在某的场景下可能存在特殊意义。
@@ -25,7 +25,8 @@ public enum Aggregation implements EnumDict<String> { | |||
|
|||
//去重计数 | |||
DISTINCT_COUNT(flux -> flux.distinct().count(),0), | |||
NONE(numberFlux -> Reactors.ALWAYS_ZERO, 0); | |||
NONE(numberFlux -> Reactors.ALWAYS_ZERO, 0), | |||
DIFFERENCE(numberFlux -> MathFlux.sumDouble(numberFlux, Number::doubleValue), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RANGE ? 默认值应该为0,且 sumDouble应该不符合需求?
No description provided.