Skip to content

Commit 0bdd49a

Browse files
Time series now working
1 parent 939ac5f commit 0bdd49a

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/components/cylc/analysis/AnalysisTable.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,6 @@ export default {
139139
allowZeros: false,
140140
timingOption: this.timingOption
141141
},
142-
{
143-
title: `Std Dev ${times}`,
144-
key: `${formatHeader('stdDev', times)}`,
145-
formatter: formatDuration,
146-
allowZeros: true,
147-
timingOption: this.timingOption
148-
},
149142
{
150143
title: `Min ${times}`,
151144
key: `${formatHeader('min', times)}`,
@@ -191,6 +184,16 @@ export default {
191184
timingOption: this.timingOption
192185
})
193186
}
187+
// Don't show std dev for cpuTime or maxRss
188+
if (this.timingOption !== 'cpuTime' && this.timingOption !== 'maxRss') {
189+
timingHeaders.push({
190+
title: `Std Dev ${times}`,
191+
key: `${formatHeader('stdDev', times)}`,
192+
formatter: formatDuration,
193+
allowZeros: true,
194+
timingOption: this.timingOption
195+
})
196+
}
194197
return this.headers.concat(timingHeaders)
195198
}
196199
},

src/components/cylc/analysis/TimeSeries.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ const jobFields = [
123123
'queueTime',
124124
'runTime',
125125
'startedTime',
126-
'maxRss'
126+
'maxRss',
127+
'cpuTime'
127128
]
128129
129130
/** The one-off query which retrieves historical job timing statistics */
@@ -370,7 +371,7 @@ export default {
370371
if (!value) {
371372
return null
372373
}
373-
const y = formatDuration(value, true)
374+
const y = formatDuration(value, true, this.timingOption)
374375
const platform = this.series[seriesIndex].data[dataPointIndex].platform
375376
return `${y} (${platform})`
376377
}

src/utils/tasks.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ export function jobMessageOutputs (jobNode) {
9898
* 00:00:00, rather than undefined
9999
* @return {string=} Formatted duration
100100
*/
101-
export function formatDuration (value, allowZeros = false, timingOption = false) {
102-
// Smaller number of seconds are formatted as HH:MM:SS
101+
export function formatDuration (value, allowZeros = false, timingOption = false) {
102+
// Times are formatted as HH:MM:SS
103103
if (timingOption === 'queue' || timingOption === 'total' || timingOption === 'run' || timingOption === 'cpuTime') {
104104
if (value || (value === 0 && allowZeros === true)) {
105+
// Convert CPU time to seconds
105106
if (timingOption === 'cpuTime') {
106107
value = value / 1000
107108
}
@@ -120,7 +121,7 @@ export function jobMessageOutputs (jobNode) {
120121
':' + minutes.toString().padStart(2, '0') +
121122
':' + Math.round(seconds).toString().padStart(2, '0')
122123
}
123-
// Larger number means it's memory
124+
// If memory value passed
124125
} else if (timingOption === 'maxRss') {
125126
if (value / 1024 < 5000) {
126127
const kilobytes = value / 1024

0 commit comments

Comments
 (0)