Skip to content

Commit

Permalink
Telemetry: Send preset value to telemetry
Browse files Browse the repository at this point in the history
fixes: #2861
  • Loading branch information
praveenkumar committed Jan 20, 2022
1 parent 702f2b3 commit 275b2ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/crc/machine/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ func (client *client) Start(ctx context.Context, startConfig types.StartConfig)
telemetry.SetCPUs(ctx, startConfig.CPUs)
telemetry.SetMemory(ctx, uint64(startConfig.Memory)*1024*1024)
telemetry.SetDiskSize(ctx, uint64(startConfig.DiskSize)*1024*1024*1024)
telemetry.SetPreset(ctx, startConfig.Preset)

if err := client.validateStartConfig(startConfig); err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions pkg/crc/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"sync"

"github.com/code-ready/crc/pkg/crc/constants"
crcpreset "github.com/code-ready/crc/pkg/crc/preset"
)

type contextKey struct{}
Expand Down Expand Up @@ -77,6 +78,10 @@ func SetConfigurationKey(ctx context.Context, value string) {
setContextProperty(ctx, "key", value)
}

func SetPreset(ctx context.Context, value crcpreset.Preset) {
setContextProperty(ctx, "preset", value)
}

func SetStartType(ctx context.Context, value StartType) {
setContextProperty(ctx, "start-type", value)
}
Expand Down

0 comments on commit 275b2ad

Please sign in to comment.