diff --git a/configs/default_metrics.json b/configs/default_metrics.json deleted file mode 100644 index 7c392cc..0000000 --- a/configs/default_metrics.json +++ /dev/null @@ -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" - } - ] -} diff --git a/internal/config/default_metrics.go b/internal/config/default_metrics.go index f8a0e34..d710aa0 100644 --- a/internal/config/default_metrics.go +++ b/internal/config/default_metrics.go @@ -11,6 +11,8 @@ import ( "strings" ) +// DEPRECATED: SUPERSEDED BY NEW USER CONFIG - userConfig.go / web.go + type DefaultMetricsCluster struct { Name string `json:"name"` DefaultMetrics string `json:"default_metrics"` diff --git a/internal/repository/user.go b/internal/repository/user.go index 1dca7f4..5cab2b0 100644 --- a/internal/repository/user.go +++ b/internal/repository/user.go @@ -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) + // DEPRECATED: SUPERSEDED BY NEW USER CONFIG - userConfig.go / web.go defaultMetricsCfg, err := config.LoadDefaultMetricsConfig() if err != nil { 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) 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"). Columns("username", "confkey", "value"). Values(user.Username, confKey, string(metricsJSON)). @@ -151,6 +153,7 @@ func (r *UserRepository) AddUser(user *schema.User) error { } } } + // END DEPRECATION return nil }