Skip to content

Commit

Permalink
feat: add exec_duration
Browse files Browse the repository at this point in the history
  • Loading branch information
angristan committed Jun 19, 2021
1 parent 00b043e commit 2c2e403
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
18 changes: 10 additions & 8 deletions job_queue_rabbitmq.go
Expand Up @@ -16,10 +16,11 @@ type jobQueue struct {
}

type jobStatus struct {
ID string `json:"id"`
Status string `json:"status"`
StdErr string `json:"stderr"`
StdOut string `json:"stdout"`
ID string `json:"id"`
Status string `json:"status"`
StdErr string `json:"stderr"`
StdOut string `json:"stdout"`
ExecDuration int `json:"exec_duration"`
}

func newJobQueue(endpoint string) jobQueue {
Expand Down Expand Up @@ -137,10 +138,11 @@ func (q jobQueue) setjobFailed(ctx context.Context, job benchJob) error {
}
func (q jobQueue) setjobResult(ctx context.Context, job benchJob, res agentExecRes) error {
jobStatus := &jobStatus{
ID: job.ID,
Status: "done",
StdErr: res.StdErr,
StdOut: res.StdOut,
ID: job.ID,
Status: "done",
StdErr: res.StdErr,
StdOut: res.StdOut,
ExecDuration: res.ExecDuration,
}
log.WithField("jobStatus", jobStatus).Info("Set job result")

Expand Down
5 changes: 3 additions & 2 deletions main.go
Expand Up @@ -35,8 +35,9 @@ type agentRunReq struct {
}

type agentExecRes struct {
StdErr string `json:"stderr"`
StdOut string `json:"stdout"`
StdErr string `json:"stderr"`
StdOut string `json:"stdout"`
ExecDuration int `json:"exec_duration"`
}

type runningFirecracker struct {
Expand Down

0 comments on commit 2c2e403

Please sign in to comment.