mirror of
				https://github.com/ClusterCockpit/cc-metric-collector.git
				synced 2025-10-31 00:55:06 +01:00 
			
		
		
		
	Update sample collectors
This commit is contained in:
		| @@ -4,8 +4,8 @@ import ( | ||||
| 	"encoding/json" | ||||
| 	"time" | ||||
|  | ||||
| 	cclog "github.com/ClusterCockpit/cc-metric-collector/pkg/ccLogger" | ||||
| 	lp "github.com/ClusterCockpit/cc-energy-manager/pkg/cc-message" | ||||
| 	cclog "github.com/ClusterCockpit/cc-metric-collector/pkg/ccLogger" | ||||
| ) | ||||
|  | ||||
| // These are the fields we read from the JSON configuration | ||||
| @@ -32,7 +32,7 @@ type SampleCollector struct { | ||||
| func (m *SampleCollector) Init(config json.RawMessage) error { | ||||
| 	var err error = nil | ||||
| 	// Always set the name early in Init() to use it in cclog.Component* functions | ||||
| 	m.name = "InternalCollector" | ||||
| 	m.name = "SampleCollector" | ||||
| 	// This is for later use, also call it early | ||||
| 	m.setup() | ||||
| 	// Tell whether the collector should be run in parallel with others (reading files, ...) | ||||
|   | ||||
| @@ -5,8 +5,8 @@ import ( | ||||
| 	"sync" | ||||
| 	"time" | ||||
|  | ||||
| 	cclog "github.com/ClusterCockpit/cc-metric-collector/pkg/ccLogger" | ||||
| 	lp "github.com/ClusterCockpit/cc-energy-manager/pkg/cc-message" | ||||
| 	cclog "github.com/ClusterCockpit/cc-metric-collector/pkg/ccLogger" | ||||
| ) | ||||
|  | ||||
| // These are the fields we read from the JSON configuration | ||||
| @@ -25,7 +25,7 @@ type SampleTimerCollector struct { | ||||
| 	config   SampleTimerCollectorConfig // the configuration structure | ||||
| 	interval time.Duration              // the interval parsed from configuration | ||||
| 	ticker   *time.Ticker               // own timer | ||||
| 	output   chan lp.CCMessage           // own internal output channel | ||||
| 	output   chan lp.CCMessage          // own internal output channel | ||||
| } | ||||
|  | ||||
| func (m *SampleTimerCollector) Init(name string, config json.RawMessage) error { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user