Skip to content

Commit c48a0f3

Browse files
authored
Merge pull request #36 from terinjokes/patches/run-timings
feat(cmd/curl): include timings in JSON output
2 parents 2684cd1 + f841ed1 commit c48a0f3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

perfops/run.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type (
5656
Output interface{} `json:"output,omitempty"`
5757
Message string `json:"message,omitempty"`
5858
Finished interface{} `json:"finished"`
59+
Timing *RunTiming `json:"timing,omitempty"`
5960
}
6061

6162
// RunItem represents an item of an MTR or ping output.
@@ -72,6 +73,14 @@ type (
7273
Items []*RunItem `json:"items,omitempty"`
7374
}
7475

76+
// RunTiming represents the test timings.
77+
RunTiming struct {
78+
Total float64 `json:"total,omitempty,string"`
79+
DNS float64 `json:"dns,omitempty,string"`
80+
Connect float64 `json:"connect,omitempty,string"`
81+
TTFB float64 `json:"ttfb,omityempty,string"`
82+
}
83+
7584
// DNSPerfRequest represents the parameters for a DNS perf request.
7685
DNSPerfRequest struct {
7786
Target string `json:"target,omitempty"`

0 commit comments

Comments
 (0)