count duration for attempt
This commit is contained in:
parent
9c9e79be15
commit
b837639f97
File diff suppressed because one or more lines are too long
@ -14,8 +14,9 @@ type Meta interface {
|
||||
}
|
||||
|
||||
type AttemptHeader struct {
|
||||
Code int `json:"code"`
|
||||
Headers http.Header `json:"headers"`
|
||||
Code int `json:"code"`
|
||||
Headers http.Header `json:"headers"`
|
||||
StartedAt time.Time `json:"started_at"`
|
||||
}
|
||||
|
||||
type Attempt struct {
|
||||
|
@ -40,8 +40,15 @@
|
||||
<dl class="row">
|
||||
<dt class="col-sm-3">ID</dt>
|
||||
<dd class="col-sm-9">{{.AttemptID}}</dd>
|
||||
<dt class="col-sm-3">Created at</dt>
|
||||
<dd class="col-sm-9">{{.Attempt.CreatedAt.Format "02 Jan 06 15:04:05.000 MST"}}</dd>
|
||||
<dt class="col-sm-3">Started at</dt>
|
||||
<dd class="col-sm-9">
|
||||
{{.Attempt.StartedAt.Format "02 Jan 06 15:04:05.000 MST"}}
|
||||
</dd>
|
||||
<dt class="col-sm-3">Finished at</dt>
|
||||
<dd class="col-sm-9">
|
||||
{{.Attempt.CreatedAt.Format "02 Jan 06 15:04:05.000 MST"}}
|
||||
<footer class="blockquote-footer">after {{.Attempt.CreatedAt.Sub .Attempt.StartedAt}}</footer>
|
||||
</dd>
|
||||
<dt class="col-sm-3">Code</dt>
|
||||
<dd class="col-sm-9">{{.Attempt.Code}}</dd>
|
||||
</dl>
|
||||
|
@ -301,8 +301,10 @@ func (mgr *Worker) call(ctx context.Context, requestID string, info *meta.Reques
|
||||
|
||||
err = mgr.blob.Push(attemptID, func(out io.Writer) error {
|
||||
res := openResponse(out)
|
||||
started := time.Now()
|
||||
mgr.handler.ServeHTTP(res, req)
|
||||
header = res.meta
|
||||
header.StartedAt = started
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user