JAMES-4068 Have several health checks in one rest calls#2399
Conversation
quantranhong1999
left a comment
There was a problem hiding this comment.
webadmin documentation needed
| private final Set<HealthCheck> healthChecks; | ||
| private final Map<ComponentName, HealthCheck> healthCheckMap; |
There was a problem hiding this comment.
How about keep using Set<HealthCheck> healthChecks;. We still can filter valid component names because the HealthCheck has ComponentName in itself. And remove the ugly and cheating reflection below.
There was a problem hiding this comment.
"We still can filter valid component names because the HealthCheck has ComponentName in itself." ----> with Set healthChecks, iterating through the set is needed and the cost is perf.
There was a problem hiding this comment.
iterating through the set is needed and the cost is perf.
Not that much IMO:
- the set size is small
- healthcheck does not need to be super performant
There was a problem hiding this comment.
discussed with @quantranhong1999 --> ignore
There was a problem hiding this comment.
| private final Set<HealthCheck> healthChecks; | ||
| private final Map<ComponentName, HealthCheck> healthCheckMap; |
There was a problem hiding this comment.
| public Object validateHealthChecks(Request request, Response response) { | ||
| Set<ComponentName> selectedComponentNames = | ||
| Arrays.stream(Optional.ofNullable(request.queryParamsValues(QUERY_PARAM_COMPONENT_NAMES)).orElse(new String[0])) | ||
| Optional.ofNullable(request.queryParamsValues(QUERY_PARAM_COMPONENT_NAMES)).map(Stream::of).orElse(Stream.empty()) |
There was a problem hiding this comment.
Maybe we can be lucky enough to have good looking indent / method extraction / ???
No description provided.