-
Notifications
You must be signed in to change notification settings - Fork 3
SED-4157-executions history #577
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
Open
lucianbaciu
wants to merge
9
commits into
master
Choose a base branch
from
SED-4157-display-execution-status-over-time-in-execution-list
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
416aafc
SED-4157-executions history
lucian-baciu 6e77df7
Merge branch 'master' into SED-4157-display-execution-status-over-tim…
lucian-baciu e446cb8
SED-4157-fixes on executions history
lucian-baciu cc51f7e
SED-4157-revert step.properties
lucian-baciu 6437fa9
Merge remote-tracking branch 'origin/master' into SED-4157-display-ex…
lucian-baciu 4b77a71
SED-4157-cleanup
lucian-baciu a201787
SED-4157-fixes
lucian-baciu 6ba87cd
SED-4157-compile fixes
lucian-baciu 6589104
SED-4157-method signature param rename
lucian-baciu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
.../step-plans-base-artefacts/src/main/java/step/reporting/ExecutionHistoryReportPlugin.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package step.reporting; | ||
|
|
||
| import ch.exense.commons.app.Configuration; | ||
| import step.core.execution.ExecutionContext; | ||
| import step.core.execution.model.Execution; | ||
| import step.core.execution.model.ExecutionAccessor; | ||
| import step.core.execution.model.ExecutionResultSnapshot; | ||
| import step.core.plugins.Plugin; | ||
| import step.engine.plugins.AbstractExecutionEnginePlugin; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.Set; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| @Plugin | ||
| public class ExecutionHistoryReportPlugin extends AbstractExecutionEnginePlugin { | ||
|
|
||
| public static final String EXECUTIONS_HISTORY_COLLECT_COUNT = "executions.history.collectCount"; | ||
|
|
||
| @Override | ||
| public void afterExecutionEnd(ExecutionContext context) { | ||
| Configuration configuration = context.getConfiguration(); | ||
| Integer countItems = configuration.getPropertyAsInteger(EXECUTIONS_HISTORY_COLLECT_COUNT, 10); | ||
| ExecutionAccessor executionAccessor = context.getExecutionAccessor(); | ||
| Execution execution = context.getExecutionManager().getExecution(); | ||
| long searchBeforeTimestamp = execution.getEndTime() != null ? execution.getEndTime() : System.currentTimeMillis(); | ||
| List<ExecutionResultSnapshot> pastExecutionsSnapshots = executionAccessor.getLastEndedExecutionsByCanonicalPlanName(execution.getImportResult().getCanonicalPlanName(), countItems, searchBeforeTimestamp, Set.of(execution.getId().toString())) | ||
| .map(e -> { | ||
| ExecutionResultSnapshot snapshot = new ExecutionResultSnapshot(); | ||
| snapshot.setId(e.getId().toString()); | ||
| snapshot.setResult(e.getResult()); | ||
| snapshot.setStatus(e.getStatus()); | ||
| snapshot.setStartTime(e.getStartTime()); | ||
| return snapshot; | ||
| }) | ||
| .collect(Collectors.toList()); | ||
| execution.setHistoryResults(pastExecutionsSnapshots); | ||
| executionAccessor.save(execution); | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...lans/step-plans-core/src/main/java/step/core/execution/model/ExecutionResultSnapshot.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package step.core.execution.model; | ||
|
|
||
| import step.core.artefacts.reports.ReportNodeStatus; | ||
|
|
||
| public class ExecutionResultSnapshot { | ||
|
|
||
| private String id; | ||
| private ExecutionStatus status; | ||
| private ReportNodeStatus result; | ||
| private long startTime; | ||
|
|
||
| public String getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public void setId(String id) { | ||
| this.id = id; | ||
| } | ||
|
|
||
| public ExecutionStatus getStatus() { | ||
| return status; | ||
| } | ||
|
|
||
| public void setStatus(ExecutionStatus status) { | ||
| this.status = status; | ||
| } | ||
|
|
||
| public ReportNodeStatus getResult() { | ||
| return result; | ||
| } | ||
|
|
||
| public void setResult(ReportNodeStatus result) { | ||
| this.result = result; | ||
| } | ||
|
|
||
| public long getStartTime() { | ||
| return startTime; | ||
| } | ||
|
|
||
| public void setStartTime(long startTime) { | ||
| this.startTime = startTime; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.