use of fish.payara.nucleus.healthcheck.HistoricHealthCheckEvent in project Payara by payara.
the class ListHistoricHealthChecks method generateReport.
private void generateReport(ActionReport actionReport) {
if (first == null) {
first = service.getHistoricalTraceStoreSize();
}
HistoricHealthCheckEvent[] traces = eventStore.getTraces(first);
ColumnFormatter columnFormatter = new ColumnFormatter(headers);
Properties extrasProps = new Properties();
List historic = new ArrayList<>();
if (traces != null) {
for (HistoricHealthCheckEvent historicHealthCheckEvent : traces) {
LinkedHashMap<String, String> messages = new LinkedHashMap<String, String>();
Object[] values = new Object[2];
values[0] = new Date(historicHealthCheckEvent.getOccurringTime());
values[1] = constructMessage(historicHealthCheckEvent);
messages.put("dateTime", values[0].toString());
messages.put("message", (String) values[1]);
historic.add(messages);
columnFormatter.addRow(values);
}
}
actionReport.setMessage(columnFormatter.toString());
extrasProps.put("historicmessages", historic);
actionReport.setExtraProperties(extrasProps);
actionReport.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Aggregations