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

FISH-333 Add Payara HealthCheck Service checkers to MicroProfile Health Readiness Checks #4883

Merged
merged 9 commits into from
Oct 4, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public HealthCheckResultStatus getStatus() {
return status;
}

public String getMessage() {
return message;
}

public Exception getException() {
return exception;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ healthcheck.checker.configuration.enabledLabel=Enabled
healthcheck.checker.configuration.enabledLabelHelpText=Enables or Disables the checker.
healthcheck.checker.configuration.dynamicLabel=Dynamic
healthcheck.checker.configuration.dynamicLabelHelpText=If checked, the HealthCheck Service will be restarted dynamically.
healthcheck.checker.configuration.displayOnHealthEndpointLabel=Display Result On Health Endpoint
healthcheck.checker.configuration.displayOnHealthEndpointHelpText=Expose the checker result to MicroProfile Health Check endpoint.
healthcheck.checker.configuration.nameLabel=Name
healthcheck.checker.configuration.nameLabelHelpText=The name of the checker.
healthcheck.checker.configuration.timeLabel=Time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@
value="#{requestScope.resp.data.subReports.get(2).extraProperties.connectionPool}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
/>
</event>
Expand All @@ -58,9 +62,10 @@
<!command
mapPut(map="#{pageSession.valueMap}" key="enabled" value="#{pageSession.enabledSelected}");
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="healthcheck-cpool");
mapPut(map="#{pageSession.valueMap}" key="displayOnHealthEndpoint" value="#{pageSession.displayOnHealthEndpointSelected}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="connection-pool");
prepareSuccessfulMsg();
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/healthcheck-service-configure-checker-with-thresholds"
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/set-healthcheck-service-configuration"
attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand All @@ -80,6 +85,11 @@
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
<sun:checkbox id="dynamicBox" selected="#{pageSession.dynamic}" selectedValue="true" />
</sun:property>
<sun:property id="displayOnHealthEndpointProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointHelpText}">
<sun:checkbox id="displayOnHealthEndpointBox" selected="#{pageSession.displayOnHealthEndpointSelected}" selectedValue="true" />
</sun:property>
<sun:property id="nameProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.nameLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.nameLabelHelpText}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@
value="#{requestScope.resp.data.subReports.get(2).extraProperties.cpuUsage}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
/>
</event>
Expand All @@ -58,9 +62,10 @@
<!command
mapPut(map="#{pageSession.valueMap}" key="enabled" value="#{pageSession.enabledSelected}");
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="healthcheck-cpu");
mapPut(map="#{pageSession.valueMap}" key="displayOnHealthEndpoint" value="#{pageSession.displayOnHealthEndpointSelected}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="cpu-usage");
prepareSuccessfulMsg();
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/healthcheck-service-configure-checker-with-thresholds"
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/set-healthcheck-service-configuration"
attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand All @@ -80,6 +85,11 @@
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
<sun:checkbox id="dynamicBox" selected="#{pageSession.dynamic}" selectedValue="true" />
</sun:property>
<sun:property id="displayOnHealthEndpointProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointHelpText}">
<sun:checkbox id="displayOnHealthEndpointBox" selected="#{pageSession.displayOnHealthEndpointSelected}" selectedValue="true" />
</sun:property>
<sun:property id="nameProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.nameLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.nameLabelHelpText}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@
value="#{requestScope.resp.data.subReports.get(0).extraProperties.garbageCollector}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
/>
</event>
Expand All @@ -78,9 +82,10 @@
<!command
mapPut(map="#{pageSession.valueMap}" key="enabled" value="#{pageSession.enabledSelected}");
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="healthcheck-gc");
mapPut(map="#{pageSession.valueMap}" key="displayOnHealthEndpoint" value="#{pageSession.displayOnHealthEndpointSelected}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="garbage-collector");
prepareSuccessfulMsg();
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/healthcheck-service-configure-checker-with-thresholds"
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/set-healthcheck-service-configuration"
attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand All @@ -100,6 +105,11 @@
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
<sun:checkbox id="dynamicBox" selected="#{pageSession.dynamic}" selectedValue="true" />
</sun:property>
<sun:property id="displayOnHealthEndpointProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointHelpText}">
<sun:checkbox id="displayOnHealthEndpointBox" selected="#{pageSession.displayOnHealthEndpointSelected}" selectedValue="true" />
</sun:property>
<sun:property id="nameProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.nameLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.nameLabelHelpText}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@
value="#{requestScope.resp.data.subReports.get(2).extraProperties.heapMemoryUsage}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
/>
</event>
Expand All @@ -58,9 +62,10 @@
<!command
mapPut(map="#{pageSession.valueMap}" key="enabled" value="#{pageSession.enabledSelected}");
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="healthcheck-heap");
mapPut(map="#{pageSession.valueMap}" key="displayOnHealthEndpoint" value="#{pageSession.displayOnHealthEndpointSelected}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="heap-memory-usage");
prepareSuccessfulMsg();
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/healthcheck-service-configure-checker-with-thresholds"
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/set-healthcheck-service-configuration"
attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand All @@ -80,6 +85,11 @@
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
<sun:checkbox id="dynamicBox" selected="#{pageSession.dynamic}" selectedValue="true" />
</sun:property>
<sun:property id="displayOnHealthEndpointProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointHelpText}">
<sun:checkbox id="displayOnHealthEndpointBox" selected="#{pageSession.displayOnHealthEndpointSelected}" selectedValue="true" />
</sun:property>
<sun:property id="nameProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.nameLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.nameLabelHelpText}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@
value="#{requestScope.resp.data.subReports.get(1).extraProperties.hoggingThreads}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
/>
</event>
Expand All @@ -58,8 +62,10 @@
<!command
mapPut(map="#{pageSession.valueMap}" key="enabled" value="#{pageSession.enabledSelected}");
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="displayOnHealthEndpoint" value="#{pageSession.displayOnHealthEndpointSelected}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="hogging-threads");
prepareSuccessfulMsg();
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/healthcheck-hoggingthreads-configure"
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/set-healthcheck-service-configuration"
attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand All @@ -79,6 +85,11 @@
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
<sun:checkbox id="dynamicBox" selected="#{pageSession.dynamic}" selectedValue="true" />
</sun:property>
<sun:property id="displayOnHealthEndpointProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointHelpText}">
<sun:checkbox id="displayOnHealthEndpointBox" selected="#{pageSession.displayOnHealthEndpointSelected}" selectedValue="true" />
</sun:property>
<sun:property id="nameProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.nameLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.nameLabelHelpText}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@
value="#{requestScope.resp.data.subReports.get(2).extraProperties.machineMemoryUsage}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.configName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
/>
</event>
Expand All @@ -58,9 +62,10 @@
<!command
mapPut(map="#{pageSession.valueMap}" key="enabled" value="#{pageSession.enabledSelected}");
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="healthcheck-machinemem");
mapPut(map="#{pageSession.valueMap}" key="displayOnHealthEndpoint" value="#{pageSession.displayOnHealthEndpointSelected}");
mapPut(map="#{pageSession.valueMap}" key="serviceName" value="machine-memory-usage");
prepareSuccessfulMsg();
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/healthcheck-service-configure-checker-with-thresholds"
gf.updateEntity(endpoint="#{pageSession.HEALTHCHECK_CONFIG_URL}/set-healthcheck-service-configuration"
attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand All @@ -80,6 +85,11 @@
helpText="$resource{i18nhx.healthcheck.configuration.dynamicLabelHelpText}">
<sun:checkbox id="dynamicBox" selected="#{pageSession.dynamic}" selectedValue="true" />
</sun:property>
<sun:property id="displayOnHealthEndpointProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.displayOnHealthEndpointHelpText}">
<sun:checkbox id="displayOnHealthEndpointBox" selected="#{pageSession.displayOnHealthEndpointSelected}" selectedValue="true" />
</sun:property>
<sun:property id="nameProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"
label="$resource{i18nhx.healthcheck.checker.configuration.nameLabel}"
helpText="$resource{i18nhx.healthcheck.checker.configuration.nameLabelHelpText}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@
value="#{requestScope.resp.data.subReports.get(4).extraProperties.mpHealth}");
mapPut(map="#{pageSession.valueMap}" key="target" value="#{pageSession.encodedConfigName}");

setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic"});
setPageSessionAttribute(key="convertToFalseList", value={"enabled", "dynamic", "displayOnHealthEndpoint"});
if (#{pageSession.valueMap['enabled']}=true) {
setPageSessionAttribute(key="enabledSelected", value="true");
}

setPageSessionAttribute(key="dynamic", value="true");
if (#{pageSession.valueMap['displayOnHealthEndpoint']}=true) {
setPageSessionAttribute(key="displayOnHealthEndpointSelected", value="true");
}
/>
</event>

Expand Down
Loading