Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.

Commit 51bbda5

Browse files
committed
Instantiate timestamp labeler only once
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent b71f352 commit 51bbda5

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎cmd/gpu-feature-discovery/main.go‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,18 @@ func run(nvml nvml.Nvml, vgpu vgpu.Interface, config *spec.Config, sigs chan os.
171171
}
172172
}()
173173

174+
timestampLabeler := lm.NewTimestampLabeler(config)
174175
rerun:
175-
labelers, err := lm.NewLabelers(nvml, vgpu, config, MachineTypePath)
176+
loopLabelers, err := lm.NewLabelers(nvml, vgpu, config, MachineTypePath)
176177
if err != nil {
177178
return false, err
178179
}
179180

181+
labelers := lm.Merge(
182+
timestampLabeler,
183+
loopLabelers,
184+
)
185+
180186
labels, err := labelers.Labels()
181187
if err != nil {
182188
return false, fmt.Errorf("error generating labels: %v", err)

‎internal/lm/labeler.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func NewLabelers(nvml nvml.Nvml, vgpu vgpu.Interface, config *spec.Config, machi
3737
}
3838

3939
l := Merge(
40-
NewTimestampLabeler(config),
4140
nvmlLabeler,
4241
NewVGPULabeler(vgpu),
4342
)

0 commit comments

Comments
 (0)