Merge branch 'main' into develop

This commit is contained in:
Thomas Gruber 2022-12-20 13:02:31 +01:00 committed by GitHub
commit b0423b842d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,6 +285,9 @@ func (m *LikwidCollector) Init(config json.RawMessage) error {
} else if !testLikwidMetricFormula(metric.Calc, globalParams) { } else if !testLikwidMetricFormula(metric.Calc, globalParams) {
cclog.ComponentError(m.name, "Metric", metric.Name, "cannot be calculated with given counters") cclog.ComponentError(m.name, "Metric", metric.Name, "cannot be calculated with given counters")
metric.Calc = "" metric.Calc = ""
} else if !checkMetricType(metric.Type) {
cclog.ComponentError(m.name, "Metric", metric.Name, "has invalid type")
metric.Calc = ""
} else { } else {
totalMetrics++ totalMetrics++
} }
@ -328,7 +331,6 @@ func (m *LikwidCollector) Init(config json.RawMessage) error {
} }
m.basefreq = getBaseFreq() m.basefreq = getBaseFreq()
m.measureThread = thread.New() m.measureThread = thread.New()
m.init = true m.init = true
return nil return nil
@ -587,6 +589,7 @@ func (m *LikwidCollector) calcGlobalMetrics(groups []LikwidEventsetConfig, inter
return nil return nil
} }
func (m *LikwidCollector) ReadThread(interval time.Duration, output chan lp.CCMetric) { func (m *LikwidCollector) ReadThread(interval time.Duration, output chan lp.CCMetric) {
var err error = nil var err error = nil
groups := make([]LikwidEventsetConfig, 0) groups := make([]LikwidEventsetConfig, 0)