Skip to content

Commit 33f24db

Browse files
Time series Y axis labels fixed.
Tests added
1 parent 75b9add commit 33f24db

File tree

4 files changed

+159
-20
lines changed

4 files changed

+159
-20
lines changed

src/components/cylc/analysis/TimeSeries.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,7 @@ export default {
392392
text: formatChartLabels(this.timingOption),
393393
},
394394
labels: {
395-
formatter: function (value) {
396-
return formatDuration(value, true)
397-
}
395+
formatter: (value) => formatDuration(value, true, this.timingOption)
398396
},
399397
},
400398
}
@@ -453,9 +451,7 @@ export default {
453451
text: formatChartLabels(this.timingOption),
454452
},
455453
labels: {
456-
formatter: function (value) {
457-
return formatDuration(value, true)
458-
}
454+
formatter: (value) => formatDuration(value, true, this.timingOption)
459455
},
460456
min: this.showOrigin ? 0 : undefined
461457
},

src/services/mock/json/analysisQuery.json

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@
1919
"stdDevQueueTime": 3,
2020
"minQueueTime": 9,
2121
"queueQuartiles": [10, 11, 13],
22-
"maxQueueTime": 14
22+
"maxQueueTime": 14,
23+
"maxMaxRss": 200000,
24+
"meanMaxRss": 100000 ,
25+
"stdDevMaxRss": 5,
26+
"minMaxRss": 50000,
27+
"maxRssQuartiles": [55000, 100000, 150000],
28+
"maxCpuTime": 30000,
29+
"meanCpuTime": 20000,
30+
"stdDevCpuTime": 5,
31+
"minCpuTime": 10000,
32+
"totalCpuTime": 200000,
33+
"cpuTimeQuartiles": [10000, 20000, 30000],
34+
"totalOfTotals": 420000
2335
},
2436
{
2537
"name": "eventually_succeeded",
@@ -39,7 +51,19 @@
3951
"stdDevQueueTime": 2,
4052
"minQueueTime": 8,
4153
"queueQuartiles": [9, 10, 11],
42-
"maxQueueTime": 11
54+
"maxQueueTime": 11,
55+
"maxMaxRss": 300000,
56+
"meanMaxRss": 200000 ,
57+
"stdDevMaxRss": 5,
58+
"minMaxRss": 60000,
59+
"maxRssQuartiles": [66000, 200000, 250000],
60+
"maxCpuTime": 20000,
61+
"meanCpuTime": 10000,
62+
"stdDevCpuTime": 5,
63+
"minCpuTime": 1000,
64+
"totalCpuTime": 200000,
65+
"cpuTimeQuartiles": [10000, 11000, 13000],
66+
"totalOfTotals": 420000
4367
},
4468
{
4569
"name": "waiting",
@@ -59,7 +83,19 @@
5983
"stdDevQueueTime": 3,
6084
"minQueueTime": 10,
6185
"queueQuartiles": [10, 12, 13],
62-
"maxQueueTime": 14
86+
"maxQueueTime": 14,
87+
"maxMaxRss": 400000,
88+
"meanMaxRss": 300000 ,
89+
"stdDevMaxRss": 5,
90+
"minMaxRss": 70000,
91+
"maxRssQuartiles": [77000, 300000, 350000],
92+
"maxCpuTime": 30000,
93+
"meanCpuTime": 20000,
94+
"stdDevCpuTime": 5,
95+
"minCpuTime": 9000,
96+
"totalCpuTime": 200000,
97+
"cpuTimeQuartiles": [10000, 11000, 13000],
98+
"totalOfTotals": 420000
6399
}
64100
]
65101
}
@@ -74,7 +110,9 @@
74110
"totalTime": 60,
75111
"queueTime": 2,
76112
"runTime": 58,
77-
"startedTime": "2023-01-01T00:00:00Z"
113+
"startedTime": "2023-01-01T00:00:00Z",
114+
"maxRss": 1000,
115+
"cpuTime": 50000
78116
},
79117
{
80118
"name": "succeeded",
@@ -83,7 +121,9 @@
83121
"totalTime": 61,
84122
"queueTime": 2,
85123
"runTime": 59,
86-
"startedTime": "2023-01-01T01:00:00Z"
124+
"startedTime": "2023-01-01T01:00:00Z",
125+
"maxRss": 1000,
126+
"cpuTime": 50000
87127
},
88128
{
89129
"name": "succeeded",
@@ -92,7 +132,9 @@
92132
"totalTime": 62,
93133
"queueTime": 2,
94134
"runTime": 60,
95-
"startedTime": "2023-01-01T02:00:00Z"
135+
"startedTime": "2023-01-01T02:00:00Z",
136+
"maxRss": 1000,
137+
"cpuTime": 50000
96138
},
97139
{
98140
"name": "eventually_succeeded",
@@ -101,7 +143,9 @@
101143
"totalTime": 41,
102144
"queueTime": 2,
103145
"runTime": 39,
104-
"startedTime": "2023-01-01T01:00:00Z"
146+
"startedTime": "2023-01-01T01:00:00Z",
147+
"maxRss": 1000,
148+
"cpuTime": 50000
105149
},
106150
{
107151
"name": "eventually_succeeded",
@@ -110,7 +154,9 @@
110154
"totalTime": 40,
111155
"queueTime": 2,
112156
"runTime": 38,
113-
"startedTime": "2023-01-01T00:00:00Z"
157+
"startedTime": "2023-01-01T00:00:00Z",
158+
"maxRss": 1000,
159+
"cpuTime": 50000
114160
},
115161
{
116162
"name": "eventually_succeeded",
@@ -119,7 +165,9 @@
119165
"totalTime": 42,
120166
"queueTime": 2,
121167
"runTime": 40,
122-
"startedTime": "2023-01-01T02:00:00Z"
168+
"startedTime": "2023-01-01T02:00:00Z",
169+
"maxRss": 1000,
170+
"cpuTime": 50000
123171
},
124172
{
125173
"name": "waiting",
@@ -128,7 +176,9 @@
128176
"totalTime": 50,
129177
"queueTime": 2,
130178
"runTime": 48,
131-
"startedTime": "2023-01-01T00:00:00Z"
179+
"startedTime": "2023-01-01T00:00:00Z",
180+
"maxRss": 1000,
181+
"cpuTime": 50000
132182
},
133183
{
134184
"name": "waiting",
@@ -137,15 +187,20 @@
137187
"totalTime": 4,
138188
"queueTime": 2,
139189
"runTime": 2,
140-
"startedTime": "2023-01-01T02:01:00Z"},
190+
"startedTime": "2023-01-01T02:01:00Z",
191+
"maxRss": 1000,
192+
"cpuTime": 50000
193+
},
141194
{
142195
"name": "waiting",
143196
"platform": "platform_2",
144197
"cyclePoint": "20240102T0000Z",
145198
"totalTime": 52,
146199
"queueTime": 2,
147200
"runTime": 50,
148-
"startedTime": "2023-01-01T02:02:00Z"
201+
"startedTime": "2023-01-01T02:02:00Z",
202+
"maxRss": 1000,
203+
"cpuTime": 50000
149204
},
150205
{
151206
"name": "waiting",
@@ -154,7 +209,9 @@
154209
"totalTime": 3,
155210
"queueTime": 2,
156211
"runTime": 1,
157-
"startedTime": "2023-01-01T02:00:00Z"
212+
"startedTime": "2023-01-01T02:00:00Z",
213+
"maxRss": 1000,
214+
"cpuTime": 50000
158215
}
159216
]
160217
}

src/utils/tasks.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ export function formatDuration (value, allowZeros = false, timingOption = false)
136136
}
137137
// the meanElapsedTime can be 0/undefined (i.e. task has not run before)
138138
// return "undefined" rather than a number for these cases
139+
console.log('got here somehow')
140+
console.log(value)
141+
console.log(timingOption)
139142
return undefined
140143
}
141144

@@ -197,4 +200,4 @@ export function formatFlowNums (flowNums) {
197200
*/
198201
export function isFlowNone (flowNums) {
199202
return Boolean(flowNums && !JSON.parse(flowNums).length)
200-
}
203+
}

tests/e2e/specs/analysis.cy.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,20 @@ describe('Analysis view', () => {
135135
cy
136136
.get('.c-analysis table > tbody > tr')
137137
.should('have.length', numTasks)
138+
// Show Max RSS
139+
cy
140+
.get('#c-analysis-filter-task-timings')
141+
.click({ force: true })
142+
cy
143+
.get('.v-list-item')
144+
.contains('Max RSS')
145+
.click({ force: true })
146+
cy
147+
.get('td')
148+
.contains('MB')
149+
cy
150+
.get('.c-analysis table > tbody > tr')
151+
.should('have.length', numTasks)
138152
})
139153

140154
it('Should filter by task name, platform and timings', () => {
@@ -207,6 +221,43 @@ describe('Analysis view', () => {
207221
.should('have.length', 1)
208222
.should('be.visible')
209223
})
224+
it('Should show Max RSS', () => {
225+
cy
226+
.get('#c-analysis-filter-task-timings')
227+
.click({ force: true })
228+
cy
229+
.get('.v-list-item')
230+
.contains('Max RSS')
231+
.click({ force: true })
232+
cy
233+
.get('td')
234+
.contains('MB')
235+
.should('be.visible')
236+
cy
237+
.get('.c-analysis table > tbody > tr')
238+
.should('have.length', numTasks)
239+
.should('be.visible')
240+
cy
241+
.get('.v-chip__content')
242+
.should('not.exist')
243+
})
244+
it('Should show CPU Time', () => {
245+
cy
246+
.get('#c-analysis-filter-task-timings')
247+
.click({ force: true })
248+
cy
249+
.get('.v-list-item')
250+
.contains('CPU Time')
251+
.click({ force: true })
252+
cy
253+
.get('td')
254+
.contains('00:00:10')
255+
.should('be.visible')
256+
cy
257+
.get('.v-chip__content')
258+
.should('exist')
259+
.contains('CPU Time')
260+
})
210261
})
211262
})
212263

@@ -232,6 +283,38 @@ describe('Analysis view', () => {
232283
.get('.vue-apexcharts')
233284
.should('not.exist')
234285
})
286+
it('Should show Max RSS', () => {
287+
cy
288+
.get('#c-analysis-filter-task-timings')
289+
.click({ force: true })
290+
cy
291+
.get('.v-list-item')
292+
.contains('Max RSS')
293+
.click({ force: true })
294+
cy
295+
.get('.apexcharts-yaxis-label')
296+
.should('have.length', numTasks)
297+
cy
298+
.get('.apexcharts-xaxis-label')
299+
.contains('MB')
300+
.should('be.visible')
301+
})
302+
it('Should show CPU Time', () => {
303+
cy
304+
.get('#c-analysis-filter-task-timings')
305+
.click({ force: true })
306+
cy
307+
.get('.v-list-item')
308+
.contains('CPU Time')
309+
.click({ force: true })
310+
cy
311+
.get('.apexcharts-yaxis-label')
312+
.should('have.length', numTasks)
313+
cy
314+
.get('.apexcharts-xaxis-label')
315+
.contains('00:00:00')
316+
.should('be.visible')
317+
})
235318

236319
it('refreshes without getting bogus apexcharts error', () => {
237320
// https://github.com/apexcharts/vue3-apexcharts/issues/79

0 commit comments

Comments
 (0)