Skip to content

Commit

Permalink
Merge pull request #115 from fuweid/extend-benchmarkreport
Browse files Browse the repository at this point in the history
contrib: enhance BenchmarkReport
  • Loading branch information
fuweid authored Apr 3, 2024
2 parents d0ea27e + 3b9a38d commit ca39f2d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
14 changes: 11 additions & 3 deletions contrib/cmd/runkperf/commands/bench/node100_job1_pod3k.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func benchNode100Job1Pod3KCaseRun(cliCtx *cli.Context) (*internaltypes.Benchmark
ctx := context.Background()
kubeCfgPath := cliCtx.GlobalString("kubeconfig")

var rgSpec types.RunnerGroupSpec
rgCfgFile, rgCfgFileDone, err := utils.NewLoadProfileFromEmbed(
"loadprofile/node100_job1_pod3k.yaml",
func(spec *types.RunnerGroupSpec) error {
Expand All @@ -62,6 +63,8 @@ func benchNode100Job1Pod3KCaseRun(cliCtx *cli.Context) (*internaltypes.Benchmark

data, _ := yaml.Marshal(spec)
klog.V(2).InfoS("Load Profile", "config", string(data))

rgSpec = *spec
return nil
},
)
Expand All @@ -79,11 +82,12 @@ func benchNode100Job1Pod3KCaseRun(cliCtx *cli.Context) (*internaltypes.Benchmark
var wg sync.WaitGroup
wg.Add(1)

jobInterval := 5 * time.Second
jobCtx, jobCancel := context.WithCancel(ctx)
go func() {
defer wg.Done()

utils.RepeatJobWith3KPod(jobCtx, kubeCfgPath, "job1pod3k", 5*time.Second)
utils.RepeatJobWith3KPod(jobCtx, kubeCfgPath, "job1pod3k", jobInterval)
}()

rgResult, derr := utils.DeployRunnerGroup(ctx,
Expand All @@ -101,7 +105,11 @@ func benchNode100Job1Pod3KCaseRun(cliCtx *cli.Context) (*internaltypes.Benchmark
}

return &internaltypes.BenchmarkReport{
RunnerGroupsReport: *rgResult,
Info: make(map[string]interface{}),
Description: fmt.Sprintf(`
Environment: 100 virtual nodes managed by kwok-controller,
Workload: Deploy 1 job with 3,000 pods repeatedly. The parallelism is 100. The interval is %v`, jobInterval),
LoadSpec: rgSpec,
Result: *rgResult,
Info: make(map[string]interface{}),
}, nil
}
9 changes: 7 additions & 2 deletions contrib/internal/types/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ import apitypes "github.com/Azure/kperf/api/types"

// BenchmarkReport represents runkperf-bench's result.
type BenchmarkReport struct {
apitypes.RunnerGroupsReport
// Description describes test case.
Description string `json:"description" yaml:"description"`
// LoadSpec represents what the load profile looks like.
LoadSpec apitypes.RunnerGroupSpec `json:"loadSpec" yaml:"loadSpec"`
// Result represents runner group's report.
Result apitypes.RunnerGroupsReport `json:"result" yaml:"result"`
// Info is additional information.
//
// FIXME(weifu): Use struct after finialized.
Info map[string]interface{}
Info map[string]interface{} `json:"info" yaml:"info"`
}

0 comments on commit ca39f2d

Please sign in to comment.