st2 icon indicating copy to clipboard operation
st2 copied to clipboard

print elapsed time in user friendly format instead of seconds on cli

Open Sheshagiri opened this issue 5 years ago • 5 comments

This is not a bug but just a small user experience improvement.

When we get the status of execution using the st2 cli time is mentioned in seconds it would be nice to print time in a user-friendly format.

image

ex: running (339s elapsed), could be: running (5m39s elapsed)

I'll try to make a pr with the changes if its okay.

Sheshagiri avatar May 12 '20 20:05 Sheshagiri

Yeah, makes better sense for CLI representation.

arm4b avatar May 12 '20 21:05 arm4b

Hi,

the PR implements the requested change with a small deviation. The elapsed time will look like this: (0:01:12 hours elapsed) or (1 day, 2:03:23 hours elapsed) instead of (1m12s elapsed). The reason is that this is the default presentation of datetime.timedelta.

Please let me know if this is not convenient enough and you prefer the requested format. In that case I add a few lines code to change the format.

winem avatar Jun 06 '20 23:06 winem

@winem thanks a lot for the pr. This is definitely better than just the number of seconds, that said while we are at this I think it would be a nice idea to having it something like 5d6h7m8s.

Sheshagiri avatar Jun 07 '20 14:06 Sheshagiri

Hi @Sheshagiri, I updated the PR and the elapsed time will be presented as requested. Guess it's the right thing to do when we're talking about a more user friendly format and my priority on "less code" was not the right one in this case. :)

winem avatar Jun 07 '20 19:06 winem

is this open ? i am new to opensource and would like this to be my first contribution if its possible !!!

shree-crypto avatar Oct 12 '24 21:10 shree-crypto