Skip to content
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

Show evaluation time in the evaluations overview #887

Merged
merged 1 commit into from Jun 29, 2021

Conversation

dasJ
Copy link
Member

@dasJ dasJ commented Mar 9, 2021

image

Copy link
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! I think the function should probably live somewhere else, to prevent confusion if someone tries to use it elsewhere. I'm not totally sure if this is the best answer, but I'd be happy enough with it.

Comment on lines 48 to 52
$c->stash->{duration2human} = sub {
my ($duration) = @_;
return Time::Seconds->new($duration)->pretty();
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably move to TT.pm:

--- a/src/lib/Hydra/View/TT.pm
+++ b/src/lib/Hydra/View/TT.pm
@@ -9,7 +9,7 @@ __PACKAGE__->config(
     ENCODING => 'utf-8',
     PRE_CHOMP => 1,
     POST_CHOMP => 1,
-    expose_methods => [qw/buildLogExists buildStepLogExists jobExists stripSSHUser/]);
+    expose_methods => [qw/buildLogExists buildStepLogExists jobExists stripSSHUser relativeDuration/]);
 
 sub buildLogExists {
     my ($self, $c, $build) = @_;
@@ -34,6 +34,11 @@ sub stripSSHUser {
     }
 }
 
+sub relativeDuration {
+    my ($self, $c, $seconds) = @_;
+    return Time::Seconds->new($seconds)->pretty();
+}
+

@grahamc
Copy link
Member

grahamc commented Jun 29, 2021

I applied my change over in master...DeterminateSystems:pr-887-review -- I propose we squash these commits if you're up for it.

Parts of this code have been authored by @grahamc
@dasJ dasJ force-pushed the feat/eval-overview-duration branch from 830c63d to 94b88b3 Compare June 29, 2021 14:53
@dasJ
Copy link
Member Author

dasJ commented Jun 29, 2021

Like this?

Copy link
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks! just waiting for CI to be green

@grahamc grahamc merged commit e02f347 into NixOS:master Jun 29, 2021
@dasJ dasJ deleted the feat/eval-overview-duration branch June 29, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants