-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Adding end time and run duration to Compare Runs view #3378
Adding end time and run duration to Compare Runs view #3378
Conversation
Signed-off-by: Arpan Bhattacharya <tell.arpan.bhattacharya@gmail.com>
@RealArpanBhattacharya Thanks for the PR and sorry for the very late reply :) Pushed a few commits to clean up the code, thanks for the contribution! |
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Useful addition
startTime: startTime ? Utils.formatTimestamp(startTime) : '(unknown)', | ||
endTime: endTime ? Utils.formatTimestamp(endTime) : '(unknown)', | ||
duration: startTime && endTime ? Utils.getDuration(startTime, endTime) : '(unknown)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we translate the (unknown)
string as well using formatMessage?
<> | ||
<tr> | ||
<th scope='row' className='head-value sticky-header' style={colWidthStyle}> | ||
<FormattedMessage | ||
defaultMessage='Start Time:' | ||
// eslint-disable-next-line max-len | ||
description='Row title for the start time of runs on the experiment compare runs page' | ||
/> | ||
</th> | ||
{runTimeAttributes.map(({ runUuid, startTime }) => [runUuid, startTime]).map(renderCell)} | ||
</tr> | ||
<tr> | ||
<th scope='row' className='head-value sticky-header' style={colWidthStyle}> | ||
<FormattedMessage | ||
defaultMessage='End Time:' | ||
// eslint-disable-next-line max-len | ||
description='Row title for the end time of runs on the experiment compare runs page' | ||
/> | ||
</th> | ||
{runTimeAttributes.map(({ runUuid, endTime }) => [runUuid, endTime]).map(renderCell)} | ||
</tr> | ||
<tr> | ||
<th scope='row' className='head-value sticky-header' style={colWidthStyle}> | ||
<FormattedMessage | ||
defaultMessage='Duration:' | ||
// eslint-disable-next-line max-len | ||
description='Row title for the duration of runs on the experiment compare runs page' | ||
/> | ||
</th> | ||
{runTimeAttributes.map(({ runUuid, duration }) => [runUuid, duration]).map(renderCell)} | ||
</tr> | ||
</> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we dry the duplicate code out?
We can create an array with all the configs and loop over the array to render each table row. What do you think?
example:
const tableCells = [
{
translation = <FormattedMessage
defaultMessage='Start Time:'
// eslint-disable-next-line max-len
description='Row title for the start time of runs on the experiment compare runs page'
/>
},
{
translation = <FormattedMessage
defaultMessage='End Time:'
// eslint-disable-next-line max-len
description='Row title for the end time of runs on the experiment compare runs page'
/>
}
....
]
usage:
tableCells.map((cell) => {
<tr>
<th scope='row' className='head-value sticky-header' style={colWidthStyle}>
{cell.translation}
</th>
{runTimeAttributes.map(({ runUuid, startTime }) => [runUuid, startTime]).map(renderCell)}
</tr>
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
"7kUi8J": { | ||
"defaultMessage": "Duration:", | ||
"description": "Row title for the duration of runs on the experiment compare runs page" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have to run the i18n extract script again to add unknown
to the default strings here
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: Arpan Bhattacharya tell.arpan.bhattacharya@gmail.com
What changes are proposed in this pull request?
In the "Compare Runs" section - display end time and run duration.
Addresses this issue.
How is this patch tested?
Still trying to figure out the automated test suite.
Screenshot:
Release Notes
Is this a user-facing change?
It is. In the "Compare Runs" section of the tracking UI, the end timestamp, and the duration of the experiment will be shown upon pushing this patch.
What component(s), interfaces, languages, and integrations does this PR affect?
Interface
area/uiux
: Front-end, user experience, JavaScript, plottingHow should the PR be classified in the release notes? Choose one:
rn/none
- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section