Commit 089c63b5 authored by Frank Winkler's avatar Frank Winkler

Improved coding style.

parent 4a652ea9
......@@ -137,18 +137,25 @@ export class JobChartComponent extends JobBaseComponent {
this.timelines = [];
var partition = "broadwell";
// default partition
var partition = "haswell";
// get current partition name
var list:string[] = this.monitoringservice.getPartitions();
for(let i = 0; i < list.length; i++){
if ( rows[0]["PARTITION"].includes(list[i]) ){
partition = list[i];
}
}
// get display names for the current partition
var displays:string[] = this.monitoringservice.getDisplays(partition);
/* we replaced cpi with ipc on Wednesday, July 17 2019 at 2pm */
if ( Number(this.job_start) < 1563364800 ){
displays[2] = "cpi";
}
// create timelines
for(let i = 0; i < displays.length; i++) {
this.timelines.push(new TimelineChart(this.monitoringservice, i, displays[i], this.selectedValueType, this.rows));
}
......
......@@ -339,22 +339,27 @@ export class MonitoringService {
getDetailedFootprints() {
return this.show_detailed_footprints;
}
getPartitions(){
getPartitions() {
return Object.keys(this.appConfig.getConfig().PartitionConfig);
}
getDisplays(partition: string){
var display_config = this.appConfig.getConfig().PartitionConfig[partition]["displays"];
if ( display_config.length > 1 ){
var displaysprefix: string[] = this.appConfig.getConfig().DefaultTimelinesTop;
display_config = displaysprefix.concat(display_config);
display_config.splice(8,1);
getDisplays(partition: string) {
var displays = this.appConfig.getConfig().PartitionConfig[partition]["displays"];
if ( displays.length > 1 ) {
var displays_top: string[] = this.appConfig.getConfig().DefaultTimelinesTop;
// remove first item from displays
displays.shift();
// combine default displays and additional displays
displays = displays_top.concat(displays);
} else {
display_config = this.appConfig.getConfig().DefaultTimelinesTop;
displays = this.appConfig.getConfig().DefaultTimelinesTop;
}
// temporary workaround
if ( partition == "ml" ) {
display_config[3] = "local_io";
display_config[5] = "local_io_meta";
displays[3] = "local_io";
displays[5] = "local_io_meta";
}
return display_config;
return displays;
}
}
......@@ -3,12 +3,14 @@
"backend_url": "http://localhost/php/",
"footprint_url": "https://hpcmon.zih.tu-dresden.de/"
},
"DefaultTimelinesTop": [
"cpu_usage", "mem_used",
"ipc", "io",
"flops", "io_meta",
"mem_bw", "infiniband_bw"
],
"PartitionConfig":{
"broadwell":{
"displays":["DefaultTimelinesTop", "cpu_power"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment