Skip to content

Commit 2c2e403

Browse files
committed
feat: add exec_duration
1 parent 00b043e commit 2c2e403

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

job_queue_rabbitmq.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ type jobQueue struct {
1616
}
1717

1818
type jobStatus struct {
19-
ID string `json:"id"`
20-
Status string `json:"status"`
21-
StdErr string `json:"stderr"`
22-
StdOut string `json:"stdout"`
19+
ID string `json:"id"`
20+
Status string `json:"status"`
21+
StdErr string `json:"stderr"`
22+
StdOut string `json:"stdout"`
23+
ExecDuration int `json:"exec_duration"`
2324
}
2425

2526
func newJobQueue(endpoint string) jobQueue {
@@ -137,10 +138,11 @@ func (q jobQueue) setjobFailed(ctx context.Context, job benchJob) error {
137138
}
138139
func (q jobQueue) setjobResult(ctx context.Context, job benchJob, res agentExecRes) error {
139140
jobStatus := &jobStatus{
140-
ID: job.ID,
141-
Status: "done",
142-
StdErr: res.StdErr,
143-
StdOut: res.StdOut,
141+
ID: job.ID,
142+
Status: "done",
143+
StdErr: res.StdErr,
144+
StdOut: res.StdOut,
145+
ExecDuration: res.ExecDuration,
144146
}
145147
log.WithField("jobStatus", jobStatus).Info("Set job result")
146148

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ type agentRunReq struct {
3535
}
3636

3737
type agentExecRes struct {
38-
StdErr string `json:"stderr"`
39-
StdOut string `json:"stdout"`
38+
StdErr string `json:"stderr"`
39+
StdOut string `json:"stdout"`
40+
ExecDuration int `json:"exec_duration"`
4041
}
4142

4243
type runningFirecracker struct {

0 commit comments

Comments
 (0)