diff --git a/extension/src/experiments/columns/constants.ts b/extension/src/experiments/columns/constants.ts index 79d1a5abac..e727eba845 100644 --- a/extension/src/experiments/columns/constants.ts +++ b/extension/src/experiments/columns/constants.ts @@ -2,7 +2,7 @@ import { ColumnType } from '../webview/contract' export const timestampColumn = { hasChildren: false, - label: 'Timestamp', - path: 'Timestamp', + label: 'Created', + path: 'Created', type: ColumnType.TIMESTAMP } diff --git a/extension/src/experiments/columns/extract.ts b/extension/src/experiments/columns/extract.ts index ccaabfe032..522d4c821f 100644 --- a/extension/src/experiments/columns/extract.ts +++ b/extension/src/experiments/columns/extract.ts @@ -73,7 +73,7 @@ type Columns = { deps: DepColumns | undefined metrics: MetricOrParamColumns | undefined params: MetricOrParamColumns | undefined - Timestamp: string | null | undefined + Created: string | null | undefined } export const extractColumns = ( @@ -89,7 +89,7 @@ export const extractColumns = ( ].join('\n') const columns: Columns = { - Timestamp: experiment?.timestamp, + Created: experiment?.timestamp, deps: extractDeps(experiment.deps, branch), metrics: metricsData?.columns, params: paramsData?.columns diff --git a/extension/src/experiments/model/collect.ts b/extension/src/experiments/model/collect.ts index b12fc204c2..537dd952f3 100644 --- a/extension/src/experiments/model/collect.ts +++ b/extension/src/experiments/model/collect.ts @@ -125,13 +125,13 @@ const transformColumns = ( experimentFields: ExperimentFields, branch?: Experiment ) => { - const { error, metrics, params, deps, Timestamp } = extractColumns( + const { error, metrics, params, deps, Created } = extractColumns( experimentFields, branch ) - if (Timestamp) { - experiment.Timestamp = Timestamp + if (Created) { + experiment.Created = Created } if (metrics) { experiment.metrics = metrics diff --git a/extension/src/experiments/model/status/index.test.ts b/extension/src/experiments/model/status/index.test.ts index 37fcb42442..60efcdf888 100644 --- a/extension/src/experiments/model/status/index.test.ts +++ b/extension/src/experiments/model/status/index.test.ts @@ -26,17 +26,17 @@ describe('canSelect', () => { describe('limitToMaxSelected', () => { const mockedExperiments = [ { id: '1', label: 'A' }, - { Timestamp: null, id: '2', label: 'B' }, - { Timestamp: '2022-02-20T09:10:52', id: '3', label: 'C' }, - { Timestamp: '2022-02-20T09:10:53', id: '4', label: 'D' }, - { Timestamp: '2022-02-20T09:10:54', id: '5', label: 'E' }, - { Timestamp: '2022-02-20T09:10:55', id: '6', label: 'F' }, - { Timestamp: '2022-02-20T09:10:56', id: '7', label: 'G' }, - { Timestamp: '2022-02-20T09:10:57', id: '8', label: 'H' }, - { Timestamp: '2022-02-20T09:10:58', id: '9', label: 'I' } + { Created: null, id: '2', label: 'B' }, + { Created: '2022-02-20T09:10:52', id: '3', label: 'C' }, + { Created: '2022-02-20T09:10:53', id: '4', label: 'D' }, + { Created: '2022-02-20T09:10:54', id: '5', label: 'E' }, + { Created: '2022-02-20T09:10:55', id: '6', label: 'F' }, + { Created: '2022-02-20T09:10:56', id: '7', label: 'G' }, + { Created: '2022-02-20T09:10:57', id: '8', label: 'H' }, + { Created: '2022-02-20T09:10:58', id: '9', label: 'I' } ] as Experiment[] - it('should return the first 7 selected by Timestamp', () => { + it('should return the first 7 selected by Created', () => { expect( limitToMaxSelected(mockedExperiments) .map(({ label }) => label) diff --git a/extension/src/experiments/model/status/index.ts b/extension/src/experiments/model/status/index.ts index a416418ecc..449dc1f047 100644 --- a/extension/src/experiments/model/status/index.ts +++ b/extension/src/experiments/model/status/index.ts @@ -20,7 +20,7 @@ const getEpoch = (timestamp: string | null | undefined) => new Date(timestamp || 0).getTime() const compareTimestamps = (a: Experiment, b: Experiment) => - getEpoch(b.Timestamp) - getEpoch(a.Timestamp) + getEpoch(b.Created) - getEpoch(a.Created) export const limitToMaxSelected = (experiments: Experiment[]) => experiments diff --git a/extension/src/experiments/webview/contract.ts b/extension/src/experiments/webview/contract.ts index 67644effdc..06ce17b0bd 100644 --- a/extension/src/experiments/webview/contract.ts +++ b/extension/src/experiments/webview/contract.ts @@ -30,7 +30,7 @@ export interface Experiment extends BaseExperimentFields { selected?: boolean sha?: string starred?: boolean - Timestamp?: string + Created?: string } export interface Row extends Experiment { diff --git a/extension/src/test/fixtures/expShow/dataTypes.ts b/extension/src/test/fixtures/expShow/dataTypes.ts index 484c82a202..6069de15db 100644 --- a/extension/src/test/fixtures/expShow/dataTypes.ts +++ b/extension/src/test/fixtures/expShow/dataTypes.ts @@ -175,7 +175,7 @@ export const rows: Row[] = [ selected: true, sha: '53c3851f46955fa3e2b8f6e1c52999acc8c9ea77', starred: false, - Timestamp: '2020-11-21T19:58:22' + Created: '2020-11-21T19:58:22' } ] diff --git a/extension/src/test/fixtures/expShow/deeplyNested.ts b/extension/src/test/fixtures/expShow/deeplyNested.ts index 3b46ead5c4..002a826f5f 100644 --- a/extension/src/test/fixtures/expShow/deeplyNested.ts +++ b/extension/src/test/fixtures/expShow/deeplyNested.ts @@ -249,7 +249,7 @@ export const rows = [ { id: 'main', label: 'main', - Timestamp: '2020-11-21T19:58:22', + Created: '2020-11-21T19:58:22', queued: false, running: false, executor: null, diff --git a/extension/src/test/fixtures/expShow/rows.ts b/extension/src/test/fixtures/expShow/rows.ts index 73836755b0..5c5900d5c8 100644 --- a/extension/src/test/fixtures/expShow/rows.ts +++ b/extension/src/test/fixtures/expShow/rows.ts @@ -368,7 +368,7 @@ const data: Row[] = [ selected: false, sha: 'd1343a87c6ee4a2e82d19525964d2fb2cb6756c9', starred: false, - Timestamp: '2020-12-29T15:31:51' + Created: '2020-12-29T15:31:51' }, { checkpoint_tip: '4fb124aebddb2adf1545030907687fa9a4c80e70', @@ -461,10 +461,10 @@ const data: Row[] = [ selected: false, sha: '1ee5f2ecb0fa4d83cbf614386536344cf894dd53', starred: false, - Timestamp: '2020-12-29T15:31:44' + Created: '2020-12-29T15:31:44' } ], - Timestamp: '2020-12-29T15:31:52' + Created: '2020-12-29T15:31:52' }, { checkpoint_parent: '217312476f8854dda1865450b737eb6bc7a3ba1b', @@ -649,7 +649,7 @@ const data: Row[] = [ selected: false, starred: false, sha: '217312476f8854dda1865450b737eb6bc7a3ba1b', - Timestamp: '2020-12-29T15:28:57' + Created: '2020-12-29T15:28:57' }, { checkpoint_tip: '42b8736b08170529903cd203a1f40382a4b4a8cd', @@ -742,10 +742,10 @@ const data: Row[] = [ selected: false, sha: '9523bde67538cf31230efaff2dbc47d38a944ab5', starred: false, - Timestamp: '2020-12-29T15:28:50' + Created: '2020-12-29T15:28:50' } ], - Timestamp: '2020-12-29T15:28:59' + Created: '2020-12-29T15:28:59' }, { checkpoint_parent: '22e40e1fa3c916ac567f69b85969e3066a91dda4', @@ -930,7 +930,7 @@ const data: Row[] = [ selected: false, sha: '22e40e1fa3c916ac567f69b85969e3066a91dda4', starred: false, - Timestamp: '2020-12-29T15:27:01' + Created: '2020-12-29T15:27:01' }, { checkpoint_tip: '1ba7bcd6ce6154e72e18b155475663ecbbd1f49d', @@ -1023,7 +1023,7 @@ const data: Row[] = [ selected: false, sha: '91116c1eae4b79cb1f5ab0312dfd9b3e43608e15', starred: false, - Timestamp: '2020-12-29T15:26:55' + Created: '2020-12-29T15:26:55' }, { checkpoint_parent: 'c658f8b14ac819ac2a5ea0449da6c15dbe8eb880', @@ -1116,7 +1116,7 @@ const data: Row[] = [ selected: false, sha: 'e821416bfafb4bc28b3e0a8ddb322505b0ad2361', starred: false, - Timestamp: '2020-12-29T15:26:49' + Created: '2020-12-29T15:26:49' }, { checkpoint_parent: '23250b33e3d6dd0e136262d1d26a2face031cb03', @@ -1209,7 +1209,7 @@ const data: Row[] = [ selected: false, sha: 'c658f8b14ac819ac2a5ea0449da6c15dbe8eb880', starred: false, - Timestamp: '2020-12-29T15:26:43' + Created: '2020-12-29T15:26:43' }, { checkpoint_parent: '53c3851f46955fa3e2b8f6e1c52999acc8c9ea77', @@ -1302,10 +1302,10 @@ const data: Row[] = [ selected: false, sha: '23250b33e3d6dd0e136262d1d26a2face031cb03', starred: false, - Timestamp: '2020-12-29T15:26:36' + Created: '2020-12-29T15:26:36' } ], - Timestamp: '2020-12-29T15:27:02' + Created: '2020-12-29T15:27:02' }, { displayColor: colorsList[5], @@ -1400,7 +1400,7 @@ const data: Row[] = [ selected: true, sha: 'f0f918662b4f8c47819ca154a23029bf9b47d4f3', starred: false, - Timestamp: '2020-12-29T15:26:36' + Created: '2020-12-29T15:26:36' }, { deps: { @@ -1476,10 +1476,10 @@ const data: Row[] = [ queued: true, sha: '90aea7f2482117a55dfcadcdb901aaa6610fbbc9', starred: false, - Timestamp: '2020-12-29T15:25:27' + Created: '2020-12-29T15:25:27' } ], - Timestamp: '2020-11-21T19:58:22' + Created: '2020-11-21T19:58:22' } ] diff --git a/webview/src/experiments/components/Experiments.tsx b/webview/src/experiments/components/Experiments.tsx index 88cf765f83..4bdc5843cc 100644 --- a/webview/src/experiments/components/Experiments.tsx +++ b/webview/src/experiments/components/Experiments.tsx @@ -54,7 +54,7 @@ const ExperimentHeader = () => ( ) const TimestampHeader = () => ( -