github.com/kubewharf/katalyst-core@v0.5.3/pkg/config/agent/sysadvisor/sysadvisor_base.go (about) 1 /* 2 Copyright 2022 The Katalyst Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package sysadvisor 18 19 import ( 20 "github.com/kubewharf/katalyst-core/pkg/config/agent/sysadvisor/inference" 21 "github.com/kubewharf/katalyst-core/pkg/config/agent/sysadvisor/metacache" 22 metricemitter "github.com/kubewharf/katalyst-core/pkg/config/agent/sysadvisor/metric-emitter" 23 "github.com/kubewharf/katalyst-core/pkg/config/agent/sysadvisor/overcommit" 24 "github.com/kubewharf/katalyst-core/pkg/config/agent/sysadvisor/qosaware" 25 ) 26 27 // GenericSysAdvisorConfiguration stores configurations of generic sysadvisor 28 type GenericSysAdvisorConfiguration struct { 29 SysAdvisorPlugins []string 30 StateFileDirectory string 31 } 32 33 // NewGenericSysAdvisorConfiguration creates a new generic sysadvisor plugin configuration. 34 func NewGenericSysAdvisorConfiguration() *GenericSysAdvisorConfiguration { 35 return &GenericSysAdvisorConfiguration{} 36 } 37 38 // SysAdvisorPluginsConfiguration stores configurations of sysadvisor plugins 39 type SysAdvisorPluginsConfiguration struct { 40 *qosaware.QoSAwarePluginConfiguration 41 *metacache.MetaCachePluginConfiguration 42 *metricemitter.MetricEmitterPluginConfiguration 43 *inference.InferencePluginConfiguration 44 *overcommit.OvercommitAwarePluginConfiguration 45 } 46 47 // NewSysAdvisorPluginsConfiguration creates a new sysadvisor plugins configuration. 48 func NewSysAdvisorPluginsConfiguration() *SysAdvisorPluginsConfiguration { 49 return &SysAdvisorPluginsConfiguration{ 50 QoSAwarePluginConfiguration: qosaware.NewQoSAwarePluginConfiguration(), 51 MetaCachePluginConfiguration: metacache.NewMetaCachePluginConfiguration(), 52 MetricEmitterPluginConfiguration: metricemitter.NewMetricEmitterPluginConfiguration(), 53 InferencePluginConfiguration: inference.NewInferencePluginConfiguration(), 54 OvercommitAwarePluginConfiguration: overcommit.NewOvercommitAwarePluginConfiguration(), 55 } 56 }