Skip to content

Commit

Permalink
profiler-url
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan4th committed Jul 12, 2024
1 parent 9a47b16 commit 8036ba4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions systest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ node_selector ?=
namespace ?=
label ?=
count ?= 1
profiler_url ?=

configname ?= $(test_job_name)
smesher_config ?= parameters/fastnet/smesher.json
Expand Down Expand Up @@ -69,6 +70,7 @@ template:
@echo post-init-image=$(post_init_image) >> $(tmpfile)
@echo keep=$(keep) >> $(tmpfile)
@echo testid=$(test_id) >> $(tmpfile)
@echo profiler-url=$(profiler_url) >>$(tmpfile)

.PHONY: config
config: template
Expand Down
3 changes: 3 additions & 0 deletions systest/cluster/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@ func deployNode(
"--metrics",
"--metrics-port=" + strconv.Itoa(prometheusScrapePort),
}
if ctx.ProfilerURL != "" {
cmd = append(cmd, "--profiler-url", ctx.ProfilerURL, "--profiler-name", ctx.TestName)
}
for _, flag := range flags {
cmd = append(cmd, flag.Flag())
}
Expand Down
7 changes: 7 additions & 0 deletions systest/testcontext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ var (
LayersPerEpoch = parameters.Int(
ParamLayersPerEpoch, "number of layers in an epoch", 4,
)
profilerURL = parameters.String(
"profiler-url", "profiler url", "",
)
)

const nsfile = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
Expand Down Expand Up @@ -183,6 +186,8 @@ type Context struct {
}
NodeSelector map[string]string
Log *zap.SugaredLogger
TestName string
ProfilerURL string
}

func cleanup(tb testing.TB, f func()) {
Expand Down Expand Up @@ -365,6 +370,8 @@ func New(t *testing.T, opts ...Opt) *Context {
PostInitImage: postInitImage.Get(p),
NodeSelector: nodeSelector.Get(p),
Log: logger.Sugar().Named(t.Name()),
TestName: t.Name(),
ProfilerURL: profilerURL.Get(p),
}
cctx.Storage.Class = class
cctx.Storage.Size = size
Expand Down

0 comments on commit 8036ba4

Please sign in to comment.