mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-17 10:25:56 +02:00
* Add cpu_used (all-cpu_idle) to CpustatCollector * Update cc-metric-collector.init * Allow selection of timestamp precision in HttpSink * Add comment about precision requirement for cc-metric-store * Fix for API changes in gofish@v0.15.0 * Update requirements to latest version * Read sensors through redfish * Update golang toolchain to 1.21 * Remove stray error check * Update main config in configuration.md * Update Release action to use golang 1.22 stable release, no golang RPMs anymore * Update runonce action to use golang 1.22 stable release, no golang RPMs anymore * Switch to CCMessage for all files. --------- Co-authored-by: Holger Obermaier <Holger.Obermaier@kit.edu> Co-authored-by: Holger Obermaier <40787752+ho-ob@users.noreply.github.com>
28 lines
704 B
Go
28 lines
704 B
Go
package sinks
|
|
|
|
import (
|
|
lp "github.com/ClusterCockpit/cc-energy-manager/pkg/cc-message"
|
|
)
|
|
|
|
type defaultSinkConfig struct {
|
|
MetaAsTags []string `json:"meta_as_tags,omitempty"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type sink struct {
|
|
meta_as_tags map[string]bool // Use meta data tags as tags
|
|
name string // Name of the sink
|
|
}
|
|
|
|
type Sink interface {
|
|
Write(point lp.CCMessage) error // Write metric to the sink
|
|
Flush() error // Flush buffered metrics
|
|
Close() // Close / finish metric sink
|
|
Name() string // Name of the metric sink
|
|
}
|
|
|
|
// Name returns the name of the metric sink
|
|
func (s *sink) Name() string {
|
|
return s.name
|
|
}
|