mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-17 02:15:55 +02:00
Fix merge issues
This commit is contained in:
parent
2611b1e301
commit
445cfe9159
@ -365,7 +365,6 @@ func (m *LikwidCollector) Init(config json.RawMessage) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// take a measurement for 'interval' seconds of event set index 'group'
|
||||
func (m *LikwidCollector) takeMeasurement(group int, interval time.Duration) error {
|
||||
|
||||
@ -399,7 +398,7 @@ func (m *LikwidCollector) takeMeasurement(group int, interval time.Duration) err
|
||||
}
|
||||
|
||||
// Get all measurement results for an event set, derive the metric values out of the measurement results and send it
|
||||
func (m *LikwidCollector) calcEventsetMetrics(group int, interval time.Duration, output chan lp.CCMetric) error {
|
||||
func (m *LikwidCollector) calcEventsetMetrics(group int, interval time.Duration, output chan *lp.CCMetric) error {
|
||||
var eidx C.int
|
||||
evset := m.config.Eventsets[group]
|
||||
gid := m.groups[group]
|
||||
@ -446,7 +445,7 @@ func (m *LikwidCollector) calcEventsetMetrics(group int, interval time.Duration,
|
||||
fields := map[string]interface{}{"value": value}
|
||||
y, err := lp.New(metric.Name, tags, m.meta, fields, time.Now())
|
||||
if err == nil {
|
||||
output <- y
|
||||
output <- &y
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -456,7 +455,7 @@ func (m *LikwidCollector) calcEventsetMetrics(group int, interval time.Duration,
|
||||
}
|
||||
|
||||
// Go over the global metrics, derive the value out of the event sets' metric values and send it
|
||||
func (m *LikwidCollector) calcGlobalMetrics(interval time.Duration, output chan lp.CCMetric) error {
|
||||
func (m *LikwidCollector) calcGlobalMetrics(interval time.Duration, output chan *lp.CCMetric) error {
|
||||
for _, metric := range m.config.Metrics {
|
||||
scopemap := m.scopeRespTids[metric.Scope]
|
||||
for domain, tid := range scopemap {
|
||||
@ -483,7 +482,7 @@ func (m *LikwidCollector) calcGlobalMetrics(interval time.Duration, output chan
|
||||
fields := map[string]interface{}{"value": value}
|
||||
y, err := lp.New(metric.Name, tags, m.meta, fields, time.Now())
|
||||
if err == nil {
|
||||
output <- y
|
||||
output <- &y
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -492,12 +491,12 @@ func (m *LikwidCollector) calcGlobalMetrics(interval time.Duration, output chan
|
||||
}
|
||||
|
||||
// main read function taking multiple measurement rounds, each 'interval' seconds long
|
||||
func (m *LikwidCollector) Read(interval time.Duration, output chan lp.CCMetric) {
|
||||
func (m *LikwidCollector) Read(interval time.Duration, output chan *lp.CCMetric) {
|
||||
if !m.init {
|
||||
return
|
||||
}
|
||||
|
||||
for i, _ := range m.groups {
|
||||
for i := range m.groups {
|
||||
// measure event set 'i' for 'interval' seconds
|
||||
err := m.takeMeasurement(i, interval)
|
||||
if err != nil {
|
||||
|
@ -135,7 +135,6 @@ func (r *metricRouter) StartTimer() {
|
||||
cclog.ComponentDebug("MetricRouter", "TIMER START")
|
||||
}
|
||||
|
||||
|
||||
func getParamMap(point lp.CCMetric) map[string]interface{} {
|
||||
params := make(map[string]interface{})
|
||||
params["metric"] = point
|
||||
@ -162,7 +161,7 @@ func (r *metricRouter) DoAddTags(point *lp.CCMetric) {
|
||||
conditionMatches = true
|
||||
} else {
|
||||
var err error
|
||||
conditionMatches, err = EvalBoolCondition(m.Condition, getParamMap(point))
|
||||
conditionMatches, err = EvalBoolCondition(m.Condition, getParamMap(*point))
|
||||
if err != nil {
|
||||
cclog.ComponentError("MetricRouter", err.Error())
|
||||
conditionMatches = false
|
||||
@ -183,7 +182,7 @@ func (r *metricRouter) DoDelTags(point *lp.CCMetric) {
|
||||
conditionMatches = true
|
||||
} else {
|
||||
var err error
|
||||
conditionMatches, err = EvalBoolCondition(m.Condition, getParamMap(point))
|
||||
conditionMatches, err = EvalBoolCondition(m.Condition, getParamMap(*point))
|
||||
if err != nil {
|
||||
cclog.ComponentError("MetricRouter", err.Error())
|
||||
conditionMatches = false
|
||||
@ -198,7 +197,7 @@ func (r *metricRouter) DoDelTags(point *lp.CCMetric) {
|
||||
// Conditional test whether a metric should be dropped
|
||||
func (r *metricRouter) dropMetric(point *lp.CCMetric) bool {
|
||||
// Simple drop check
|
||||
if _, ok := r.config.dropMetrics[(*point).Name()]; ok {
|
||||
if _, ok := r.config.dropMetrics[(*point).Name()]; ok {
|
||||
return true
|
||||
}
|
||||
// Checking the dropping conditions
|
||||
@ -231,8 +230,8 @@ func (r *metricRouter) Start() {
|
||||
cclog.ComponentDebug("MetricRouter", "FORWARD", *point)
|
||||
r.DoAddTags(point)
|
||||
r.DoDelTags(point)
|
||||
if new, ok := r.config.RenameMetrics[point.Name()]; ok {
|
||||
point.SetName(new)
|
||||
if new, ok := r.config.RenameMetrics[(*point).Name()]; ok {
|
||||
(*point).SetName(new)
|
||||
}
|
||||
r.DoAddTags(point)
|
||||
r.DoDelTags(point)
|
||||
|
Loading…
x
Reference in New Issue
Block a user