mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 21:09:05 +01:00
increase server timeout limit, improve and add db indices
- change energy footprint key to string
This commit is contained in:
parent
084f89fa32
commit
cff60eb51c
@ -260,8 +260,8 @@ func serverStart() {
|
||||
})
|
||||
|
||||
server = &http.Server{
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
ReadTimeout: 20 * time.Second,
|
||||
WriteTimeout: 20 * time.Second,
|
||||
Handler: handler,
|
||||
Addr: config.Keys.Addr,
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
CREATE INDEX IF NOT EXISTS job_by_project ON job (project);
|
||||
CREATE INDEX IF NOT EXISTS job_list_projects ON job (project, job_state);
|
||||
CREATE INDEX IF NOT EXISTS jobs_cluster_orderby_starttime ON job (cluster, start_time DESC);
|
||||
CREATE INDEX IF NOT EXISTS jobs_cluster_count ON job (cluster, job_state, start_time);
|
||||
CREATE INDEX IF NOT EXISTS jobs_project_orderby_starttime ON job (project, start_time DESC);
|
||||
CREATE INDEX IF NOT EXISTS jobs_project_count ON job (project, job_state, start_time);
|
||||
|
||||
ALTER TABLE job ADD COLUMN energy REAL NOT NULL DEFAULT 0.0;
|
||||
ALTER TABLE job ADD COLUMN energy_footprint TEXT DEFAULT NULL;
|
||||
@ -24,3 +26,5 @@ ALTER TABLE job DROP net_bw_avg;
|
||||
ALTER TABLE job DROP net_data_vol_total;
|
||||
ALTER TABLE job DROP file_bw_avg;
|
||||
ALTER TABLE job DROP file_data_vol_total;
|
||||
|
||||
PRAGMA optimize;
|
@ -88,7 +88,7 @@ func initClusterConfig() error {
|
||||
sc.Footprint = append(sc.Footprint, newMetric.Name)
|
||||
ml.Footprint = newMetric.Footprint
|
||||
}
|
||||
if newMetric.Energy {
|
||||
if newMetric.Energy != "" {
|
||||
sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name)
|
||||
}
|
||||
}
|
||||
@ -99,7 +99,7 @@ func initClusterConfig() error {
|
||||
if newMetric.Footprint != "" {
|
||||
sc.Footprint = append(sc.Footprint, newMetric.Name)
|
||||
}
|
||||
if newMetric.Energy {
|
||||
if newMetric.Energy != "" {
|
||||
sc.EnergyFootprint = append(sc.EnergyFootprint, newMetric.Name)
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ type SubClusterConfig struct {
|
||||
Alert float64 `json:"alert"`
|
||||
Remove bool `json:"remove"`
|
||||
LowerIsBetter bool `json:"lowerIsBetter"`
|
||||
Energy bool `json:"energy"`
|
||||
Energy string `json:"energy"`
|
||||
}
|
||||
|
||||
type MetricConfig struct {
|
||||
@ -70,7 +70,7 @@ type MetricConfig struct {
|
||||
Alert float64 `json:"alert"`
|
||||
Timestep int `json:"timestep"`
|
||||
LowerIsBetter bool `json:"lowerIsBetter"`
|
||||
Energy bool `json:"energy"`
|
||||
Energy string `json:"energy"`
|
||||
}
|
||||
|
||||
type Cluster struct {
|
||||
|
@ -50,7 +50,11 @@
|
||||
},
|
||||
"energy": {
|
||||
"description": "Is it used to calculate job energy",
|
||||
"type": "boolean"
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"power",
|
||||
"energy"
|
||||
]
|
||||
},
|
||||
"lowerIsBetter": {
|
||||
"description": "Is lower better.",
|
||||
@ -93,7 +97,11 @@
|
||||
},
|
||||
"energy": {
|
||||
"description": "Is it used to calculate job energy. Overwrite global",
|
||||
"type": "boolean"
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"power",
|
||||
"energy"
|
||||
]
|
||||
},
|
||||
"lowerIsBetter": {
|
||||
"description": "Is lower better. Overwrite global",
|
||||
|
Loading…
Reference in New Issue
Block a user