-
Notifications
You must be signed in to change notification settings - Fork 16
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
No exact execution start timestamp and duration #436 #439
Conversation
@@ -77,12 +77,16 @@ protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse r | |||
return ResponseEntity.ok("Script successfully executed") | |||
.addEntry("status", status.getStatus()) | |||
.addEntry("output", ((ExecutionStatus.FinishedSuccessfulExecution) status).getEntries()) | |||
.addEntry("path", ((ExecutionStatus.FinishedSuccessfulExecution) status).getPath()); | |||
.addEntry("path", ((ExecutionStatus.FinishedSuccessfulExecution) status).getPath()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why these casts are neeed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why/ how about using direct type here? if cast is used then abstraction should be dropped
public Calendar getStartTime() { | ||
return startTime; | ||
} | ||
|
||
@Override | ||
public long determineExecutionDuration() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opt-in / if you could use more dedicated types like https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html
List<ExecutionResult.Entry> entries = executionSummary.getResult().getEntries(); | ||
ExecutionResult.Entry errorEntry = executionSummary.getResult().getLastError(); | ||
if (errorEntry != null) { | ||
return new ExecutionStatus.FinishedFailedExecution(path, entries, errorEntry); | ||
return new ExecutionStatus.FinishedFailedExecution(path, timestamp, formattedDate, entries, errorEntry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExecutionXX.YyYYExecution
DRY rule violated
formattedDate = determineFormattedDate(date); | ||
} | ||
|
||
public static String determineFormattedDate(Calendar date) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about just format()
/ KISS rule ;)
fully qualified it will be DateFormatter.format
instead of DateFormatter.determineFormattedDate
No description provided.