mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-26 15:29:04 +01:00
Catch panicing collectors (hello Nvidia Go Bindings) late.
This commit is contained in:
parent
7a7ce0c1b3
commit
75f5ac8980
@ -13,6 +13,7 @@ import (
|
|||||||
type MetricGetter interface {
|
type MetricGetter interface {
|
||||||
Name() string
|
Name() string
|
||||||
Init(config []byte) error
|
Init(config []byte) error
|
||||||
|
Initialized() bool
|
||||||
Read(time.Duration, *[]lp.MutableMetric)
|
Read(time.Duration, *[]lp.MutableMetric)
|
||||||
Close()
|
Close()
|
||||||
}
|
}
|
||||||
@ -30,6 +31,10 @@ func (c *MetricCollector) setup() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *MetricCollector) Initialized() bool {
|
||||||
|
return c.init == true
|
||||||
|
}
|
||||||
|
|
||||||
func intArrayContains(array []int, str int) (int, bool) {
|
func intArrayContains(array []int, str int) (int, bool) {
|
||||||
for i, a := range array {
|
for i, a := range array {
|
||||||
if a == str {
|
if a == str {
|
||||||
|
Loading…
Reference in New Issue
Block a user