Skip to content

Commit

Permalink
[O2B-886] Add total TF size alongside the total CTF size on lhc fill …
Browse files Browse the repository at this point in the history
…display

- [X] branch and/or PR name(s) include(s) JIRA ID
- [X] issue has "Fix version" assigned
- [X] issue "Status" is set to "In review"
- [X] PR labels are selected

Notable changes for users:
- Adds total TF size display to LHC fill details, renamed 'total CTF' to 'total CTF size'
  • Loading branch information
GMvdDonck authored Jun 29, 2023
1 parent 60547da commit 6c34b38
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/public/services/lhcFill/LhcFillStatisticsExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class LhcFillStatisticsExtractor {
this._rawTimeSegments = [];

this._totalCtfFileSize = 0;
this._totalTfFileSize = 0;

for (const run of runs) {
this.addRun(run);
Expand All @@ -76,7 +77,7 @@ export class LhcFillStatisticsExtractor {
* @return {void}
*/
addRun(run) {
const { runQuality, detectors, startTime, endTime, ctfFileSize } = run;
const { runQuality, detectors, startTime, endTime, ctfFileSize, tfFileSize } = run;

// If the run do not overlap with LHC fill at all or is not well-defined, do not consider it
if (
Expand Down Expand Up @@ -113,6 +114,11 @@ export class LhcFillStatisticsExtractor {
if (!isNaN(numericCtfFileSize)) {
this._totalCtfFileSize += numericCtfFileSize;
}

const numericTfFileSize = parseInt(tfFileSize, 10);
if (!isNaN(numericTfFileSize)) {
this._totalTfFileSize += numericTfFileSize;
}
}

/**
Expand Down Expand Up @@ -162,6 +168,7 @@ export class LhcFillStatisticsExtractor {
meanRunDuration: totalRunsDuration / this._rawTimeSegments.length,
runsCoverage,
totalCtfFileSize: this._totalCtfFileSize,
totalTfFileSize: this._totalTfFileSize,
};
}
}
6 changes: 5 additions & 1 deletion lib/public/views/LhcFills/Detail/lhcFillDetailsComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export const stableBeamStatisticsDisplayConfiguration = [
format: (efficiency) => formatPercentage(efficiency),
},
totalCtfFileSize: {
name: 'Total CTF ',
name: 'Total CTF size',
format: formatFileSize,
},
totalTfFileSize: {
name: 'Total TF size',
format: formatFileSize,
},
},
Expand Down
2 changes: 2 additions & 0 deletions test/public/lhcFills/detail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ module.exports = () => {
expect(efficiency.endsWith('41.67%')).to.be.true;
const totalCtf = await page.$eval('#lhc-fill-totalCtfFileSize', (element) => element.innerText);
expect(totalCtf.endsWith('67.9569 GB')).to.be.true;
const totalTf = await page.$eval('#lhc-fill-totalTfFileSize', (element) => element.innerText);
expect(totalTf.endsWith('741.801 GB')).to.be.true;
const durationBeforeFirstRun = await page.$eval('#lhc-fill-durationBeforeFirstRun', (element) => element.innerText);
expect(durationBeforeFirstRun.endsWith('03:00:00 (25.00%)')).to.be.true;
const durationAfterLastRun = await page.$eval('#lhc-fill-durationAfterLastRun', (element) => element.innerText);
Expand Down

0 comments on commit 6c34b38

Please sign in to comment.