Skip to content

Commit

Permalink
renamed NewConfig to New - as per go naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
val06 committed Nov 6, 2024
1 parent d14f522 commit a3e32d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/system-probe/modules/gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var GPUMonitoring = module.Factory{
ConfigNamespaces: gpuMonitoringConfigNamespaces,
Fn: func(_ *sysconfigtypes.Config, deps module.FactoryDependencies) (module.Module, error) {

c := gpuconfig.NewConfig()
c := gpuconfig.New()
probeDeps := gpu.ProbeDependencies{
Telemetry: deps.Telemetry,
//if the config parameter doesn't exist or is empty string, the default value is used as defined in go-nvml library
Expand Down
4 changes: 2 additions & 2 deletions pkg/gpu/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ type Config struct {
NVMLLibraryPath string
}

// NewConfig generates a new configuration for the GPU monitoring probe.
func NewConfig() *Config {
// New generates a new configuration for the GPU monitoring probe.
func New() *Config {
spCfg := pkgconfigsetup.SystemProbe()
return &Config{
Config: *ebpf.NewConfig(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/gpu/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

func TestConsumerCanStartAndStop(t *testing.T) {
handler := ddebpf.NewRingBufferHandler(consumerChannelSize)
cfg := config.NewConfig()
cfg := config.New()
ctx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot())
require.NoError(t, err)
consumer := newCudaEventConsumer(ctx, handler, cfg)
Expand Down
6 changes: 3 additions & 3 deletions pkg/gpu/probe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestProbeCanLoad(t *testing.T) {
t.Skipf("minimum kernel version not met, %v", err)
}

cfg := config.NewConfig()
cfg := config.New()
cfg.InitialProcessSync = false
nvmlMock := testutil.GetBasicNvmlMock()
probe, err := NewProbe(cfg, ProbeDependencies{NvmlLib: nvmlMock})
Expand All @@ -47,7 +47,7 @@ func TestProbeCanReceiveEvents(t *testing.T) {
require.NoError(t, procMon.Initialize(false))
t.Cleanup(procMon.Stop)

cfg := config.NewConfig()
cfg := config.New()
cfg.InitialProcessSync = false
cfg.BPFDebug = true

Expand Down Expand Up @@ -101,7 +101,7 @@ func TestProbeCanGenerateStats(t *testing.T) {
require.NoError(t, procMon.Initialize(false))
t.Cleanup(procMon.Stop)

cfg := config.NewConfig()
cfg := config.New()
cfg.InitialProcessSync = false
cfg.BPFDebug = true

Expand Down

0 comments on commit a3e32d7

Please sign in to comment.