mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-11-01 00:15:05 +01:00
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"clusters": [
|
|
||||||
{
|
|
||||||
"name": "fritz",
|
|
||||||
"default_metrics": "cpu_load, flops_any, core_power, lustre_open, mem_used, mem_bw, net_bytes_in"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "alex",
|
|
||||||
"default_metrics": "flops_any, mem_bw, mem_used, vectorization_ratio"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -11,6 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DEPRECATED: SUPERSEDED BY NEW USER CONFIG - userConfig.go / web.go
|
||||||
|
|
||||||
type DefaultMetricsCluster struct {
|
type DefaultMetricsCluster struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
DefaultMetrics string `json:"default_metrics"`
|
DefaultMetrics string `json:"default_metrics"`
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ func (r *UserRepository) AddUser(user *schema.User) error {
|
|||||||
|
|
||||||
cclog.Infof("new user %#v created (roles: %s, auth-source: %d, projects: %s)", user.Username, rolesJson, user.AuthSource, projectsJson)
|
cclog.Infof("new user %#v created (roles: %s, auth-source: %d, projects: %s)", user.Username, rolesJson, user.AuthSource, projectsJson)
|
||||||
|
|
||||||
|
// DEPRECATED: SUPERSEDED BY NEW USER CONFIG - userConfig.go / web.go
|
||||||
defaultMetricsCfg, err := config.LoadDefaultMetricsConfig()
|
defaultMetricsCfg, err := config.LoadDefaultMetricsConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cclog.Errorf("Error loading default metrics config: %v", err)
|
cclog.Errorf("Error loading default metrics config: %v", err)
|
||||||
@@ -140,7 +141,8 @@ func (r *UserRepository) AddUser(user *schema.User) error {
|
|||||||
cclog.Errorf("Error marshaling default metrics for cluster %s: %v", cluster.Name, err)
|
cclog.Errorf("Error marshaling default metrics for cluster %s: %v", cluster.Name, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
confKey := "job_view_selectedMetrics:" + cluster.Name
|
// Note: StatisticsTable now has different key (metricConfig_jobViewTableMetrics): Not updated here.
|
||||||
|
confKey := "metricConfig_jobViewPlotMetrics:" + cluster.Name
|
||||||
if _, err := sq.Insert("configuration").
|
if _, err := sq.Insert("configuration").
|
||||||
Columns("username", "confkey", "value").
|
Columns("username", "confkey", "value").
|
||||||
Values(user.Username, confKey, string(metricsJSON)).
|
Values(user.Username, confKey, string(metricsJSON)).
|
||||||
@@ -151,6 +153,7 @@ func (r *UserRepository) AddUser(user *schema.User) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// END DEPRECATION
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user