MCPcopy Create free account
hub / github.com/efficientgo/e2e / NewParca

Function NewParca

profiling/profiling.go:41–78  ·  view source on GitHub ↗
(env e2e.Environment, name string, image string, flagOverride map[string]string)

Source from the content-addressed store, hash-verified

39}
40
41func NewParca(env e2e.Environment, name string, image string, flagOverride map[string]string) *Parca {
42 if image == "" {
43 image = "ghcr.io/parca-dev/parca:main-4e20a666"
44 }
45
46 f := env.Runnable(name).WithPorts(map[string]int{"http": 7070}).Future()
47
48 args := map[string]string{
49 "--config-path": filepath.Join(f.Dir(), "parca.yml"),
50 }
51 if flagOverride != nil {
52 args = e2e.MergeFlagsWithoutRemovingEmpty(args, flagOverride)
53 }
54
55 config := `
56object_storage:
57 bucket:
58 type: "FILESYSTEM"
59 config:
60 directory: "./data"
61`
62 if err := os.WriteFile(filepath.Join(f.Dir(), "parca.yml"), []byte(config), 0600); err != nil {
63 return &Parca{Runnable: e2e.NewFailedRunnable(name, errors.Wrap(err, "create Parca config failed"))}
64 }
65
66 p := e2emon.AsInstrumented(f.Init(e2e.StartOptions{
67 Image: image,
68 Command: e2e.NewCommand("/parca", e2e.BuildArgs(args)...),
69 User: strconv.Itoa(os.Getuid()),
70 Readiness: e2e.NewTCPReadinessProbe("http"),
71 }), "http")
72
73 return &Parca{
74 configHeader: config,
75 Runnable: p,
76 Instrumented: p,
77 }
78}
79
80// SetScrapeConfigs updates Parca with new configuration.
81func (p *Parca) SetScrapeConfigs(scrapeJobs []parcaconfig.ScrapeConfig) error {

Callers 1

StartFunction · 0.70

Calls 10

NewFailedRunnableFunction · 0.92
NewCommandFunction · 0.92
BuildArgsFunction · 0.92
NewTCPReadinessProbeFunction · 0.92
FutureMethod · 0.65
WithPortsMethod · 0.65
RunnableMethod · 0.65
DirMethod · 0.65
InitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…