Corrected some typos

This commit is contained in:
Holger Obermaier 2022-11-14 09:35:02 +01:00
parent 9e63d0ea59
commit fd10a279fc
3 changed files with 9 additions and 9 deletions

View File

@ -51,7 +51,7 @@ A collector reads data from any source, parses it to metrics and submits these m
* `Name() string`: Return the name of the collector * `Name() string`: Return the name of the collector
* `Init(config json.RawMessage) error`: Initializes the collector using the given collector-specific config in JSON. Check if needed files/commands exists, ... * `Init(config json.RawMessage) error`: Initializes the collector using the given collector-specific config in JSON. Check if needed files/commands exists, ...
* `Initialized() bool`: Check if a collector is successfully initialized * `Initialized() bool`: Check if a collector is successfully initialized
* `Read(duration time.Duration, output chan ccMetric.CCMetric)`: Read, parse and submit data to the `output` channel as [`CCMetric`](../internal/ccMetric/README.md). If the collector has to measure anything for some duration, use the provided function argument `duration`. * `Read(duration time.Duration, output chan ccMetric.CCMetric)`: Read, parse and submit data to the `output` channel as [`CCMetric`](../internal/ccMetric/README.md). If the collector has to measure anything for some duration, use the provided function argument `duration`.
* `Close()`: Closes down the collector. * `Close()`: Closes down the collector.
It is recommanded to call `setup()` in the `Init()` function. It is recommanded to call `setup()` in the `Init()` function.

View File

@ -17,9 +17,9 @@ type SampleCollectorConfig struct {
// defined by metricCollector (name, init, ...) // defined by metricCollector (name, init, ...)
type SampleCollector struct { type SampleCollector struct {
metricCollector metricCollector
config SampleTimerCollectorConfig // the configuration structure config SampleCollectorConfig // the configuration structure
meta map[string]string // default meta information meta map[string]string // default meta information
tags map[string]string // default tags tags map[string]string // default tags
} }
// Functions to implement MetricCollector interface // Functions to implement MetricCollector interface
@ -36,14 +36,14 @@ func (m *SampleCollector) Init(config json.RawMessage) error {
// 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, ...)
// or it should be run serially, mostly for collectors acutally doing measurements // or it should be run serially, mostly for collectors actually doing measurements
// because they should not measure the execution of the other collectors // because they should not measure the execution of the other collectors
m.parallel = true m.parallel = true
// Define meta information sent with each metric // Define meta information sent with each metric
// (Can also be dynamic or this is the basic set with extension through AddMeta()) // (Can also be dynamic or this is the basic set with extension through AddMeta())
m.meta = map[string]string{"source": m.name, "group": "SAMPLE"} m.meta = map[string]string{"source": m.name, "group": "SAMPLE"}
// Define tags sent with each metric // Define tags sent with each metric
// The 'type' tag is always needed, it defines the granulatity of the metric // The 'type' tag is always needed, it defines the granularity of the metric
// node -> whole system // node -> whole system
// socket -> CPU socket (requires socket ID as 'type-id' tag) // socket -> CPU socket (requires socket ID as 'type-id' tag)
// die -> CPU die (requires CPU die ID as 'type-id' tag) // die -> CPU die (requires CPU die ID as 'type-id' tag)

View File

@ -38,7 +38,7 @@ func (m *SampleTimerCollector) Init(name string, config json.RawMessage) error {
// (Can also be dynamic or this is the basic set with extension through AddMeta()) // (Can also be dynamic or this is the basic set with extension through AddMeta())
m.meta = map[string]string{"source": m.name, "group": "SAMPLE"} m.meta = map[string]string{"source": m.name, "group": "SAMPLE"}
// Define tags sent with each metric // Define tags sent with each metric
// The 'type' tag is always needed, it defines the granulatity of the metric // The 'type' tag is always needed, it defines the granularity of the metric
// node -> whole system // node -> whole system
// socket -> CPU socket (requires socket ID as 'type-id' tag) // socket -> CPU socket (requires socket ID as 'type-id' tag)
// cpu -> single CPU hardware thread (requires cpu ID as 'type-id' tag) // cpu -> single CPU hardware thread (requires cpu ID as 'type-id' tag)
@ -60,7 +60,7 @@ func (m *SampleTimerCollector) Init(name string, config json.RawMessage) error {
// Storage for output channel // Storage for output channel
m.output = nil m.output = nil
// Mangement channel for the timer function. // Management channel for the timer function.
m.done = make(chan bool) m.done = make(chan bool)
// Create the own ticker // Create the own ticker
m.ticker = time.NewTicker(m.interval) m.ticker = time.NewTicker(m.interval)
@ -94,7 +94,7 @@ func (m *SampleTimerCollector) ReadMetrics(timestamp time.Time) {
value := 1.0 value := 1.0
// If you want to measure something for a specific amout of time, use interval // If you want to measure something for a specific amount of time, use interval
// start := readState() // start := readState()
// time.Sleep(interval) // time.Sleep(interval)
// stop := readState() // stop := readState()