Skip to content

Commit

Permalink
Change zbus client getter to be public
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrahmanElawady committed Oct 16, 2023
1 parent f70015a commit 687d2c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/perf/cpubench_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *CPUBenchmarkTask) Run(ctx context.Context) (interface{}, error) {
if err != nil {
return nil, fmt.Errorf("failed to parse cpubench output: %w", err)
}
client := getZbusClient(ctx)
client := GetZbusClient(ctx)
statistics := stubs.NewStatisticsStub(client)

workloads, err := statistics.Workloads(ctx)
Expand Down
3 changes: 2 additions & 1 deletion pkg/perf/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func withZbusClient(ctx context.Context, client zbus.Client) context.Context {
return context.WithValue(ctx, zbusClient{}, client)
}

func getZbusClient(ctx context.Context) zbus.Client {
// GetZbusClient gets zbus client from the given context
func GetZbusClient(ctx context.Context) zbus.Client {
return ctx.Value(zbusClient{}).(zbus.Client)
}

0 comments on commit 687d2c8

Please sign in to comment.