trackRun wraps "run" with metrics.
(ctx context.Context, script codersdk.WorkspaceAgentScript, option ExecuteOption)
| 235 | |
| 236 | // trackRun wraps "run" with metrics. |
| 237 | func (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. |
no test coverage detected