Skip to content
Snippets Groups Projects
Commit 79e7d89a authored by Ramesh Kumar's avatar Ramesh Kumar
Browse files

TMSS-894: Update Cycle report fields based on updated API response data.

parent e49756f9
No related branches found
No related tags found
3 merge requests!634WIP: COBALT commissioning delta,!524TMSS-894: TMSS-902 Move to top button added in cycle report, TMSS-903 Dialog...,!481Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
......@@ -100,11 +100,11 @@ class CycleCategoryWiseData extends Component{
const cycleData = repData.data_ingested_per_site_and_category;
categoryData['cycle'] = repData.cycle;
// TODO: Update field names and values once API is complete
categoryData['rawIF'] = cycleData["Interferometric Observation"].dataproducts.length;
categoryData['rawBF'] = cycleData["Beamformed Observation"].dataproducts.length;
categoryData['rawIF'] = cycleData["Interferometric Observation"].size__sum;
categoryData['rawBF'] = cycleData["Beamformed Observation"].size__sum;
categoryData['rawTBB'] = cycleData.rawTBB;
categoryData['preprocIF'] = cycleData["Preprocessing Pipeline"].dataproducts.length;
categoryData['pulpBF'] = cycleData["Pulsar Pipeline"].dataproducts.length;
categoryData['preprocIF'] = cycleData["Preprocessing Pipeline"].size__sum;
categoryData['pulpBF'] = cycleData["Pulsar Pipeline"].size__sum;
categoryData['dynspecBF'] = cycleData.dynspecBF;
reportData.push(categoryData);
});
......
......@@ -127,7 +127,8 @@ class CycleCompletionLevel extends Component {
const completionLevel = repData.completion_level;
reportData.push( {cycle: repData.cycle,
performed: completionLevel.total?parseInt((completionLevel.succeeded/completionLevel.total*100).toFixed(0)):null,
prognosis: completionLevel.total?parseInt((completionLevel.prognosis/completionLevel.total*100).toFixed(0)):null,
// prognosis: completionLevel.total?parseInt((completionLevel.prognosis/completionLevel.total*100).toFixed(0)):null,
prognosis: completionLevel.prognosis,
target: repData.completion_level.target?repData.completion_level.target*100:null} );
});
if (forTable && reportData.length > 0) {
......
......@@ -101,13 +101,14 @@ class CycleFailureRate extends Component {
// [{cycle: 'Cycle 15', failures: [{month: "2020-06-01", duration: 1200}, {month: "2020-07-01", duration: 1300},....]}]
let reportData = {chartData: [], monthTableData: [], cycleTableData: []};
_.map(data, repData=> {
const monthlyFailures = repData.failures;
const monthlyFailures = repData.failures.months;
let cycleMonthlyFailures = []
for (const failureData of monthlyFailures) {
cycleMonthlyFailures.push({ cycle: repData.cycle,
date: failureData.month,
month: moment(failureData.month).format("YYYY-MM"),
duration: failureData.duration?(failureData.duration/timeConversionFactor).toFixed(2):null
// duration: failureData.duration?(failureData.duration/timeConversionFactor).toFixed(2):null
duration: failureData.total_failed?(failureData.total_failed/timeConversionFactor).toFixed(2):null
});
}
reportData.chartData = reportData.chartData.concat(cycleMonthlyFailures);
......@@ -115,7 +116,7 @@ class CycleFailureRate extends Component {
cycle: repData.cycle,
period: _.minBy(cycleMonthlyFailures, 'date')?
`${(_.minBy(cycleMonthlyFailures, 'date')).month} - ${(_.maxBy(cycleMonthlyFailures, 'date')).month}`:'',
duration: ((_.sumBy(monthlyFailures, 'duration'))/timeConversionFactor).toFixed(2)
duration: ((_.sumBy(monthlyFailures, 'total_failed'))/timeConversionFactor).toFixed(2)
});
});
reportData.monthTableData = reportData.chartData;
......
......@@ -30,7 +30,7 @@ class CycleProjectSummary extends Component{
projectData['cycle'] = repData.cycle;
projectData['project'] = projData.project;
// TODO: Update field names and values once API is complete
projectData['durationObserved'] = (projData.durations.total/timeConversionFactor).toFixed(2);
projectData['durationObserved'] = (projData.durations.total_observed/timeConversionFactor).toFixed(2);
projectData['durationProcessed'] = projData.durations.processed;
projectData['dataToSara'] = projData["Sara"];
projectData['dataToJuelich'] = projData["Juelich"];
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment