mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-26 15:29:04 +01:00
Respect the publish option in the LikwidCollector
This commit is contained in:
parent
d1e66201a6
commit
7182b339b9
@ -435,14 +435,16 @@ func (m *LikwidCollector) calcEventsetMetrics(group int, interval time.Duration,
|
|||||||
}
|
}
|
||||||
m.mresults[group][tid][metric.Name] = value
|
m.mresults[group][tid][metric.Name] = value
|
||||||
// Now we have the result, send it with the proper tags
|
// Now we have the result, send it with the proper tags
|
||||||
tags := map[string]string{"type": metric.Scope.String()}
|
if metric.Publish {
|
||||||
if metric.Scope != "node" {
|
tags := map[string]string{"type": metric.Scope.String()}
|
||||||
tags["type-id"] = fmt.Sprintf("%d", domain)
|
if metric.Scope != "node" {
|
||||||
}
|
tags["type-id"] = fmt.Sprintf("%d", domain)
|
||||||
fields := map[string]interface{}{"value": value}
|
}
|
||||||
y, err := lp.New(metric.Name, tags, m.meta, fields, time.Now())
|
fields := map[string]interface{}{"value": value}
|
||||||
if err == nil {
|
y, err := lp.New(metric.Name, tags, m.meta, fields, time.Now())
|
||||||
output <- y
|
if err == nil {
|
||||||
|
output <- y
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -472,14 +474,16 @@ func (m *LikwidCollector) calcGlobalMetrics(interval time.Duration, output chan
|
|||||||
}
|
}
|
||||||
m.gmresults[tid][metric.Name] = value
|
m.gmresults[tid][metric.Name] = value
|
||||||
// Now we have the result, send it with the proper tags
|
// Now we have the result, send it with the proper tags
|
||||||
tags := map[string]string{"type": metric.Scope.String()}
|
if metric.Publish {
|
||||||
if metric.Scope != "node" {
|
tags := map[string]string{"type": metric.Scope.String()}
|
||||||
tags["type-id"] = fmt.Sprintf("%d", domain)
|
if metric.Scope != "node" {
|
||||||
}
|
tags["type-id"] = fmt.Sprintf("%d", domain)
|
||||||
fields := map[string]interface{}{"value": value}
|
}
|
||||||
y, err := lp.New(metric.Name, tags, m.meta, fields, time.Now())
|
fields := map[string]interface{}{"value": value}
|
||||||
if err == nil {
|
y, err := lp.New(metric.Name, tags, m.meta, fields, time.Now())
|
||||||
output <- y
|
if err == nil {
|
||||||
|
output <- y
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user