Skip to content

Commit

Permalink
feat: add workload status to trial infobox [DET-4289] (#2349)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBonar authored May 11, 2021
1 parent 2afc2e1 commit 984ad9d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webui/react/src/pages/TrialDetails/TrialInfoBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'types';
import { isObject } from 'utils/data';
import { formatDatetime } from 'utils/date';
import { humanReadableBytes } from 'utils/string';
import { capitalize, humanReadableBytes } from 'utils/string';
import { shortEnglishHumannizer } from 'utils/time';
import { trialDurations } from 'utils/trial';
import { checkpointSize } from 'utils/types';
Expand Down Expand Up @@ -72,6 +72,9 @@ const TrialInfoBox: React.FC<Props> = ({ trial, experiment }: Props) => {
const handleShowHParams = useCallback(() => setShowHParams(true), []);
const handleHideHParams = useCallback(() => setShowHParams(false), []);

const workloadStatus: string | undefined =
Object.entries(trial.workloads.last()).find(e => !!e[1])?.first();

const infoRows = [
{
content: formatDatetime(trial.startTime),
Expand All @@ -89,6 +92,11 @@ const TrialInfoBox: React.FC<Props> = ({ trial, experiment }: Props) => {
</div>,
label: 'Durations',
},
{
content: (trial.state === 'ACTIVE' && workloadStatus !== undefined) &&
`${capitalize(workloadStatus)} on batch ${trial.totalBatchesProcessed}`,
label: 'Current Workload',
},
{
content: bestValidation &&
<>
Expand Down

0 comments on commit 984ad9d

Please sign in to comment.