|
12 | 12 | // See the License for the specific language governing permissions and |
13 | 13 | // limitations under the License. |
14 | 14 |
|
| 15 | +/* |
| 16 | +Hey supports two output formats: summary and CSV |
| 17 | +
|
| 18 | +The summary output presents a number of statistics about the requests in a |
| 19 | +human-readable format, including: |
| 20 | +- general statistics: requests/second, total runtime, and average, fastest, and slowest requests. |
| 21 | +- a response time histogram. |
| 22 | +- a percentile latency distribution. |
| 23 | +- statistics (average, fastest, slowest) on the stages of the requests. |
| 24 | +
|
| 25 | +The comma-separated CSV format is proceeded by a header, and consists of the following columns: |
| 26 | +1. response-time: Total time taken for request (in seconds) |
| 27 | +2. DNS+dialup: Time taken to establish the TCP connection (in seconds) |
| 28 | +3. DNS: Time taken to do the DNS lookup (in seconds) |
| 29 | +4. Request-write: Time taken to write full request (in seconds) |
| 30 | +5. Response-delay: Time taken to first byte received (in seconds) |
| 31 | +6. Response-read: Time taken to read full response (in seconds) |
| 32 | +7. status-code: HTTP status code of the response (e.g. 200) |
| 33 | +8. offset: The time since the start of the benchmark when the request was started. (in seconds) |
| 34 | +*/ |
15 | 35 | package requester |
16 | 36 |
|
17 | 37 | import ( |
@@ -103,7 +123,6 @@ Status code distribution:{{ range $code, $num := .StatusCodeDist }} |
103 | 123 | {{ if gt (len .ErrorDist) 0 }}Error distribution:{{ range $err, $num := .ErrorDist }} |
104 | 124 | [{{ $num }}] {{ $err }}{{ end }}{{ end }} |
105 | 125 | ` |
106 | | - csvTmpl = `{{ $connLats := .ConnLats }}{{ $dnsLats := .DnsLats }}{{ $dnsLats := .DnsLats }}{{ $reqLats := .ReqLats }}{{ $delayLats := .DelayLats }}{{ $resLats := .ResLats }}{{ $statusCodeLats := .StatusCodes }} |
107 | | -response-time,DNS+dialup,DNS,Request-write,Response-delay,Response-read,status-code{{ range $i, $v := .Lats }} |
108 | | -{{ formatNumber $v }},{{ formatNumber (index $connLats $i) }},{{ formatNumber (index $dnsLats $i) }},{{ formatNumber (index $reqLats $i) }},{{ formatNumber (index $delayLats $i) }},{{ formatNumber (index $resLats $i) }},{{ formatNumberInt (index $statusCodeLats $i) }}{{ end }}` |
| 126 | + csvTmpl = `{{ $connLats := .ConnLats }}{{ $dnsLats := .DnsLats }}{{ $dnsLats := .DnsLats }}{{ $reqLats := .ReqLats }}{{ $delayLats := .DelayLats }}{{ $resLats := .ResLats }}{{ $statusCodeLats := .StatusCodes }}{{ $offsets := .Offsets}}response-time,DNS+dialup,DNS,Request-write,Response-delay,Response-read,status-code,offset{{ range $i, $v := .Lats }} |
| 127 | +{{ formatNumber $v }},{{ formatNumber (index $connLats $i) }},{{ formatNumber (index $dnsLats $i) }},{{ formatNumber (index $reqLats $i) }},{{ formatNumber (index $delayLats $i) }},{{ formatNumber (index $resLats $i) }},{{ formatNumberInt (index $statusCodeLats $i) }},{{ formatNumber (index $offsets $i) }}{{ end }}` |
109 | 128 | ) |
0 commit comments