Benchmark

… under construction …

Benchmarking a request

Introduction

When calling erecord web services by cURL command line tool, it is possible to get information after the completed transfer, thanks to the “w” option. The available variables are (see http://curl.haxx.se/docs/manpage.html) :

  • content_type : the Content-Type of the requested document, if there was any.
  • filename_effective : the ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the –remote-name or –output option. It’s most useful in combination with the –remote-header-name option.
  • ftp_entry_path : the initial path curl ended up in when logging on to the remote FTP server.
  • http_code : the numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias response_code was added to show the same info.
  • http_connect : the numerical code that was found in the last response (from a proxy) to a curl CONNECT request.
  • local_ip : the IP address of the local end of the most recently done connection - can be either IPv4 or IPv6
  • local_port : the local port number of the most recently done connection
  • num_connects Number of new connects made in the recent transfer.
  • num_redirects Number of redirects that were followed in the request.
  • redirect_url When an HTTP request was made without -L to follow redirects, this variable will show the actual URL a redirect would take you to.
  • remote_ip : the remote IP address of the most recently done connection - can be either IPv4 or IPv6
  • remote_port : the remote port number of the most recently done connection
  • size_download : the total amount of bytes that were downloaded.
  • size_header : the total amount of bytes of the downloaded headers.
  • size_request : the total amount of bytes that were sent in the HTTP request.
  • size_upload : the total amount of bytes that were uploaded.
  • speed_download : the average download speed that curl measured for the complete download. Bytes per second.
  • speed_upload : the average upload speed that curl measured for the complete upload. Bytes per second.
  • ssl_verify_result : the result of the SSL peer certificate verification that was requested. 0 means the verification was successful.
  • time_appconnect : the time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed.
  • time_connect : the time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed.
  • time_namelookup : the time, in seconds, it took from the start until the name resolving was completed.
  • time_pretransfer : 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 : the time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections.
  • time_starttransfer : 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 needed to calculate the result.
  • time_total : the total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution.
  • url_effective : the URL that was fetched last. This is most meaningful if you’ve told curl to follow location: headers.

Examples

The information format can be specified as a literal “string” or into a file.

*** Calling erecord web services by cURL command line tool with the "w" option ***

* Information format specified as a literal "string" :

curl -L -H "Content-Type: application/json" -d '{"vpz":266, "mode":["tree","single","dataframe"], "outselect":["view.top:wwdm.LAI","view.top:wwdm.ST"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "\n\ntime_namelookup:%{time_namelookup}; time_connect:%{time_connect}; time_appconnect:%{time_appconnect}; time_pretransfer:%{time_pretransfer}; time_redirect:%{time_redirect}; time_starttransfer:%{time_starttransfer}; time_total:%{time_total}\n"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":10.0, "mode":["tree","single","dataframe"], "condLAI.dens":10.0, "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "\n\ntime_namelookup:%{time_namelookup}; time_connect:%{time_connect}; time_appconnect:%{time_appconnect}; time_pretransfer:%{time_pretransfer}; time_redirect:%{time_redirect}; time_starttransfer:%{time_starttransfer}; time_total:%{time_total}\n"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["tree","single","dataframe"], "condLAI.dens":10.0, "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "\n\ntime_namelookup:%{time_namelookup}; time_connect:%{time_connect}; time_appconnect:%{time_appconnect}; time_pretransfer:%{time_pretransfer}; time_redirect:%{time_redirect}; time_starttransfer:%{time_starttransfer}; time_total:%{time_total}\n"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["tree","linear","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "\n\ntime_namelookup:%{time_namelookup}; time_connect:%{time_connect}; time_appconnect:%{time_appconnect}; time_pretransfer:%{time_pretransfer}; time_redirect:%{time_redirect}; time_starttransfer:%{time_starttransfer}; time_total:%{time_total}\n"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["compact","linear","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "\n\ntime_namelookup:%{time_namelookup}; time_connect:%{time_connect}; time_appconnect:%{time_appconnect}; time_pretransfer:%{time_pretransfer}; time_redirect:%{time_redirect}; time_starttransfer:%{time_starttransfer}; time_total:%{time_total}\n"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["tree","linear","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":"all", "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "\n\ntime_namelookup:%{time_namelookup}; time_connect:%{time_connect}; time_appconnect:%{time_appconnect}; time_pretransfer:%{time_pretransfer}; time_redirect:%{time_redirect}; time_starttransfer:%{time_starttransfer}; time_total:%{time_total}\n"

* Information format specified into the curl-time-format.txt file :

curl -L -H "Content-Type: application/json" -d '{"vpz":266, "duration":6, "cond_wwdm.Eb":1.86, "mode":["tree","single","dataframe"], "outselect":["view.top:wwdm.LAI","view.top:wwdm.ST"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "@curl-time-format.txt"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["compact","single","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "@curl-time-format.txt"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["compact","linear","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "@curl-time-format.txt"

* Information format specified into the curl-format.txt file :

curl -L -H "Content-Type: application/json" -d '{"vpz":266, "duration":6, "cond_wwdm.Eb":1.86, "mode":["tree","single","dataframe"], "outselect":["view.top:wwdm.LAI","view.top:wwdm.ST"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "@curl-format.txt"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["compact","single","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "@curl-format.txt"

curl -L -H "Content-Type: application/json" -d '{"vpz":213, "duration":350.0, "mode":["compact","linear","dataframe"], "condLAI.dens":[9.5, 9.6, 9.7, 9.8, 9.9, 10.0, 10.1, 10.2, 10.3, 10.4], "outselect":["vueLAI"], "format":"json" }' http://erecord.toulouse.inra.fr:8000/vpz/output/ -w "@curl-format.txt"

With curl-time-format.txt content :

\n
\n
Curl information after completed transfer:
\n
            time_namelookup:  %{time_namelookup}\n
               time_connect:  %{time_connect}\n
            time_appconnect:  %{time_appconnect}\n
           time_pretransfer:  %{time_pretransfer}\n
              time_redirect:  %{time_redirect}\n
         time_starttransfer:  %{time_starttransfer}\n
                            ----------\n
                 time_total:  %{time_total}\n
\n

With curl-format.txt content :

\n
\n
Curl information after completed transfer:
\n
   content_type: %{content_type}\n
   filename_effective: %{filename_effective}\n
   ftp_entry_path: %{ftp_entry_path}\n
   http_code: %{http_code}\n
   http_connect: %{http_connect}\n
   local_ip: %{local_ip}\n
   local_port: %{local_port}\n
   num_connects: %{num_connects}\n
   num_redirects: %{num_redirects}\n
   redirect_url: %{redirect_url}\n
   remote_ip: %{remote_ip}\n
   remote_port: %{remote_port}\n
   size_download: %{size_download}\n
   size_header: %{size_header}\n
   size_request: %{size_request}\n
   size_upload: %{size_upload}\n
   speed_download: %{speed_download}\n
   speed_upload: %{speed_upload}\n
   ssl_verify_result: %{ssl_verify_result}\n
   time_appconnect: %{time_appconnect}\n
   time_connect: %{time_connect}\n
   time_namelookup: %{time_namelookup}\n
   time_pretransfer: %{time_pretransfer}\n
   time_redirect: %{time_redirect}\n
   time_starttransfer: %{time_starttransfer}\n
   time_total: %{time_total}\n
   url_effective: %{url_effective}\n
\n