curl command to get the site of all kinds of response time

curl -o /dev/null -s -w %{http_code}:%{http_connect}:%{content_type}:%{time_namelookup}:%{time_redirect}:%{time_pretransfer}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} http://www.baidu.com

 

Once each time period http request -dns resolved, waiting for the server, access to content 
below -w parameter to be a detailed explanation by me (DigDeeply) translations. There is something wrong place please point out. (English original: http: //curl.haxx.se/docs/manpage.html) 
The following is available variable name: 

 -w, --write-OUT 
 the following variables by CURL deemed appropriate output format and output variables need to follow % {variable_name} format, if desired output%, double click to, i.e. %%, at the same time, \ n-newline is, \ R & lt carriage return, \ T is TAB. 

. url_effective the URL of that WAS fetched at The Last Meaningful This IS MOST IF you've Told curl to the Follow LOCATION: headers. 

filename_effective that curl at The Ultimate filename Writes This IS OUT to curl IS IF Told Meaningful only to the Write to File with at The A -. -remote-name or --output option. It  's most useful in combination with the --remote-header-name option. (Added in 7.25.1)

http_code http status code, such as the success of 200, 301 turn, 404 not found, 500 server errors. (WAS of The Numerical Response code that found in The Last retrieved the HTTP (S) or the FTP (S) Transfer. 7.18.2 The Alias the In RESPONSE_CODE WAS added to Show The Same info.) 

Http_connect of The Numerical code that WAS found in The Last Response (from A Proxy) to the CONNECT Request A curl. (Added in 7.12.4) 

TIME_TOTAL total time, in seconds. Accurate to three decimal places. (Of The Total Time, in seconds The, that lasted The Full Operation. Will of The Time Resolution BE displayed with millisecond.) 

Time_namelookup DNS resolution time, from the beginning to the DNS resolution request completion time used. (The time, in seconds, it  took from the start until the name resolving was completed.)

time_connect connection time, from the beginning to establish a TCP connection with the completion of the time, including the front DNS resolution time, if you need to get a simple connection time, use this time minus the front time_namelookup time_connect time. The following Similarly, not repeat them. (At The Time, in seconds The, Took from an until at The Start at The TCP at The Connect to Remote Host (or Proxy) WAS Completed.) 

Time_appconnect connection setup completion time, such as SSL / SSH, etc. or complete three-way handshake to establish a connection time. (At The Time, in seconds The, Took from an until at The Start at The SSL / SSH / etc Connect / Handshake at The Remote Host to WAS Completed. (Added in 7.19.0)) 

time_pretransfer time from the beginning to prepare transmission. (The time, in seconds, it  took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol (s) involved.)

time_redirect redirection time, including before the last few redirect DNS resolution transmission connection, pre-transfer, transfer time. (At The Time, in seconds The, Took All Redirection Steps for the Lookup the include name, Connect, pretransfer the before and Transfer at The Final Transaction WAS Started. Time_redirect Shows at The Complete Execution Time for Multiple Redirections. (Added in 7.12.3)) 

time_starttransfer begin transmitting time. After the request, Web servers return data byte with the first time (The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server to the Calculate the Result at The needed.) 

size_download download size. (At The Total AMOUNT of bytes that were the Downloaded.) 

Size_upload upload size. (The total amount of bytes that were  uploaded.)

Size size_header download the header (The total amount of bytes of the  downloaded headers.)

size_request requested size. (Of The Total of bytes that were AMOUNT The Sent in the HTTP Request.) 

Speed_download download speed, the unit - bytes per second. (Downloads of The Average Speed The Complete that curl Measured for downloads Bytes per SECOND..) 

Speed_upload upload speed in - bytes per second. (At The Average Speed that curl the Measured for the Upload Complete the Upload Bytes per SECOND, at The..) 

Content_type is content-Type, needless to say, this is an example of the results of my visit to return home blog (text / html; charset = UTF -8 );. (the Type-of the Content of The Document The requested, the any IF there WAS) 

num_connects of Number The new new Made in the Connects The Recent Transfer (Added in 7.12.3). 

NUM_REDIRECTS of Number The redirects that were in the Followed The Request (Added in. 7.12.3) 

redirect_url When a HTTP request was made without -L to follow redirects, this variable will show the actual URL a redirect would take you to. (Added in 7.18.2) 

ftp_entry_path The initial path libcurl ended up in when logging on to the remote FTP server. (Added in 7.15.4) 

ssl_verify_result ssl认证结果,返回0表示认证成功。( The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. (Added in 7.19.0)) 

若多次使用-w参数,按最后一个的格式输出。If this option is used several times, the last one will be used.

 

Article reprinted from https://www.cnblogs.com/dawq/p/7661036.html

Guess you like

Origin www.cnblogs.com/ttyypjt/p/11491554.html