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