mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-12-19 05:36:17 +01:00
Add ccStartup
This commit is contained in:
@@ -36,11 +36,10 @@ There is a main configuration file with basic settings that point to the other c
|
|||||||
"collectors-file" : "collectors.json",
|
"collectors-file" : "collectors.json",
|
||||||
"receivers-file" : "receivers.json",
|
"receivers-file" : "receivers.json",
|
||||||
"router-file" : "router.json",
|
"router-file" : "router.json",
|
||||||
"main": {
|
"startup-file": "startup.json",
|
||||||
"interval": "10s",
|
"interval": "10s",
|
||||||
"duration": "1s"
|
"duration": "1s"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The `interval` defines how often the metrics should be read and send to the sink. The `duration` tells collectors how long one measurement has to take. This is important for some collectors, like the `likwid` collector. For more information, see [here](./docs/configuration.md).
|
The `interval` defines how often the metrics should be read and send to the sink. The `duration` tells collectors how long one measurement has to take. This is important for some collectors, like the `likwid` collector. For more information, see [here](./docs/configuration.md).
|
||||||
@@ -51,6 +50,7 @@ See the component READMEs for their configuration:
|
|||||||
* [`sinks`](https://github.com/ClusterCockpit/cc-lib/blob/main/sinks/README.md)
|
* [`sinks`](https://github.com/ClusterCockpit/cc-lib/blob/main/sinks/README.md)
|
||||||
* [`receivers`](https://github.com/ClusterCockpit/cc-lib/blob/main/receivers/README.md)
|
* [`receivers`](https://github.com/ClusterCockpit/cc-lib/blob/main/receivers/README.md)
|
||||||
* [`router`](./internal/metricRouter/README.md)
|
* [`router`](./internal/metricRouter/README.md)
|
||||||
|
* [`startup`](https://github.com/ClusterCockpit/cc-lib/blob/main/ccStartup/README.md)
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import (
|
|||||||
ccconf "github.com/ClusterCockpit/cc-lib/ccConfig"
|
ccconf "github.com/ClusterCockpit/cc-lib/ccConfig"
|
||||||
cclog "github.com/ClusterCockpit/cc-lib/ccLogger"
|
cclog "github.com/ClusterCockpit/cc-lib/ccLogger"
|
||||||
lp "github.com/ClusterCockpit/cc-lib/ccMessage"
|
lp "github.com/ClusterCockpit/cc-lib/ccMessage"
|
||||||
|
start "github.com/ClusterCockpit/cc-lib/ccStartup"
|
||||||
mr "github.com/ClusterCockpit/cc-metric-collector/internal/metricRouter"
|
mr "github.com/ClusterCockpit/cc-metric-collector/internal/metricRouter"
|
||||||
mct "github.com/ClusterCockpit/cc-metric-collector/pkg/multiChanTicker"
|
mct "github.com/ClusterCockpit/cc-metric-collector/pkg/multiChanTicker"
|
||||||
)
|
)
|
||||||
@@ -216,6 +217,14 @@ func mainFunc() int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startupConf := ccconf.GetPackageConfig("startup")
|
||||||
|
if len(collectorConf) > 0 {
|
||||||
|
err := start.CCStartup(startupConf)
|
||||||
|
if err != nil {
|
||||||
|
cclog.Errorf("Sending startup topology failed: %s", err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set log file
|
// Set log file
|
||||||
// if logfile := rcfg.CliArgs["logfile"]; logfile != "stderr" {
|
// if logfile := rcfg.CliArgs["logfile"]; logfile != "stderr" {
|
||||||
// cclog.SetOutput(logfile)
|
// cclog.SetOutput(logfile)
|
||||||
|
|||||||
Reference in New Issue
Block a user