MCPcopy Index your code
hub / github.com/coder/coder / trackRun

Method trackRun

agent/agentscripts/agentscripts.go:237–245  ·  view source on GitHub ↗

trackRun wraps "run" with metrics.

(ctx context.Context, script codersdk.WorkspaceAgentScript, option ExecuteOption)

Source from the content-addressed store, hash-verified

235
236// trackRun wraps "run" with metrics.
237func (r *Runner) trackRun(ctx context.Context, script codersdk.WorkspaceAgentScript, option ExecuteOption) error {
238 err := r.run(ctx, script, option)
239 if err != nil {
240 r.scriptsExecuted.WithLabelValues("false").Add(1)
241 } else {
242 r.scriptsExecuted.WithLabelValues("true").Add(1)
243 }
244 return err
245}
246
247// run executes the provided script with the timeout.
248// If the timeout is exceeded, the process is sent an interrupt signal.

Callers 2

InitMethod · 0.95
ExecuteMethod · 0.95

Calls 3

runMethod · 0.95
WithLabelValuesMethod · 0.80
AddMethod · 0.65

Tested by

no test coverage detected