-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compute: allow "instance" label to be set (behind a flag)
Fixes #262. *## What Allow `instance` label name to be set via new `-compute.instance-label` flag. *## Why See #262 for the rationale and discussion. *## How * for each compute `Collector`, create new `collectorMetrics` type containing compute metrics (moved from _global var_), to let each `Collector` own an allocated instance obtained via `newCollectorMetrics(instanceLabel)` * changing metrics from _global var_ to dynamically allocated object is needed for: * setting its label at runtime * allowing tests to be self-contained, else the 1st test to run would "own" setting `instanceLabel` * there's a new `config.CommonConfig` type, currently only having a single field `ComputeInstanceLabel`, which is passed down from `cmd/` to each instantiated _Provider_, then to each compute _Collector_ *## Testing Adapted testing with a couple `ComputeInstanceLabel="node"` changes, although it should be improved to test changes to the label name. -- Signed-off-by: JuanJo Ciarlante <[email protected]>
- Loading branch information
Showing
13 changed files
with
262 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.