Skip to content

Commit

Permalink
Fix for the issue #421 ViewCmd.java (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryryabkov authored Sep 5, 2024
1 parent 949e6eb commit 5adbb9e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/io/seqera/tower/cli/commands/runs/ViewCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,25 @@ protected Response exec() throws ApiException {
Map<String, Object> stats = new HashMap<>();
if (opts.stats) {
stats.put("wallTime", TimeUnit.MILLISECONDS.toSeconds(workflow.getDuration()) / 60D);
stats.put("cpuTime", TimeUnit.MILLISECONDS.toMinutes(progress.getWorkflowProgress().getCpuTime()) / 60D);
stats.put("totalMemory", progress.getWorkflowProgress().getMemoryRss() / 1024 / 1024 / 1024D);
stats.put("read", progress.getWorkflowProgress().getReadBytes() / 1024 / 1024 / 1024D);
stats.put("write", progress.getWorkflowProgress().getWriteBytes() / 1024 / 1024 / 1024D);
stats.put("cost", progress.getWorkflowProgress().getCost());
if(progress.getWorkflowProgress() != null) {
stats.put("cpuTime", TimeUnit.MILLISECONDS.toMinutes(progress.getWorkflowProgress().getCpuTime()) / 60D);
stats.put("totalMemory", progress.getWorkflowProgress().getMemoryRss() / 1024 / 1024 / 1024D);
stats.put("read", progress.getWorkflowProgress().getReadBytes() / 1024 / 1024 / 1024D);
stats.put("write", progress.getWorkflowProgress().getWriteBytes() / 1024 / 1024 / 1024D);
stats.put("cost", progress.getWorkflowProgress().getCost());
}
}

Map<String, Object> load = new HashMap<>();
if (opts.load) {
if (opts.load && progress.getWorkflowProgress() != null) {
load.put("peakCpus", progress.getWorkflowProgress().getPeakCpus());
load.put("loadCpus", progress.getWorkflowProgress().getLoadCpus());
load.put("peakTasks", progress.getWorkflowProgress().getPeakTasks());
load.put("loadTasks", progress.getWorkflowProgress().getLoadTasks());
}

Map<String, Object> utilization = new HashMap<>();
if (opts.utilization) {
if (opts.utilization && progress.getWorkflowProgress() != null) {
utilization.put("memoryEfficiency", progress.getWorkflowProgress().getMemoryEfficiency());
utilization.put("cpuEfficiency", progress.getWorkflowProgress().getCpuEfficiency());
}
Expand Down

0 comments on commit 5adbb9e

Please sign in to comment.