Skip to content

JAMES-4068 Have several health checks in one rest calls#2399

Merged
Arsnael merged 6 commits into
apache:masterfrom
hungphan227:JAMES-4068-Have-several-health-checks-in-one-rest-calls
Sep 9, 2024
Merged

JAMES-4068 Have several health checks in one rest calls#2399
Arsnael merged 6 commits into
apache:masterfrom
hungphan227:JAMES-4068-Have-several-health-checks-in-one-rest-calls

Conversation

@hungphan227
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Member

@quantranhong1999 quantranhong1999 left a comment

Choose a reason for hiding this comment

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

webadmin documentation needed

Comment on lines +63 to +71
private final Set<HealthCheck> healthChecks;
private final Map<ComponentName, HealthCheck> healthCheckMap;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

discussed with @quantranhong1999 --> ignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

discussed with @quantranhong1999 --> ignore

Why?

I was having same comment...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread docs/modules/servers/partials/operate/webadmin.adoc Outdated
Comment on lines +63 to +71
private final Set<HealthCheck> healthChecks;
private final Map<ComponentName, HealthCheck> healthCheckMap;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

discussed with @quantranhong1999 --> ignore

Why?

I was having same 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())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we can be lucky enough to have good looking indent / method extraction / ???

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

Comment thread docs/modules/servers/partials/operate/webadmin.adoc Outdated
@Arsnael Arsnael merged commit 097b6bd into apache:master Sep 9, 2024
samiulsami pushed a commit to opnpulse/james-project that referenced this pull request Feb 12, 2025
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.

5 participants