Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tsukasa007
Copy link

No description provided.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个映射看上去可以在上面构造聚合参数时一起构造。

};
},

DIFFERENCE("极差值") {
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RANGE ? 默认值应该为0,且 sumDouble应该不符合需求?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants