Skip to content

Commit

Permalink
fixes npe issue with --stats (#459)
Browse files Browse the repository at this point in the history
* fixes npe issue with --stats
  • Loading branch information
munishchouhan authored Oct 1, 2024
1 parent 0c1ac90 commit 3f53419
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/seqera/tower/cli/commands/runs/ViewCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ protected Response exec() throws ApiException {

Map<String, Object> stats = new HashMap<>();
if (opts.stats) {
stats.put("wallTime", TimeUnit.MILLISECONDS.toSeconds(workflow.getDuration()) / 60D);
if( workflow.getDuration() != null )
stats.put("wallTime", TimeUnit.MILLISECONDS.toSeconds(workflow.getDuration()) / 60D);
if(progress.getWorkflowProgress() != null) {
stats.put("cpuTime", TimeUnit.MILLISECONDS.toMinutes(progress.getWorkflowProgress().getCpuTime()) / 60D);
stats.put("totalMemory", progress.getWorkflowProgress().getMemoryRss() / 1024 / 1024 / 1024D);
Expand Down

0 comments on commit 3f53419

Please sign in to comment.