Mercurial > hg > orthanc
comparison Core/HttpClient.cpp @ 3516:96780208dbd7
reporting timings in HttpClient
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 11 Sep 2019 13:21:50 +0200 |
parents | 6add197274b1 |
children | d5740d3b1d67 |
comparison
equal
deleted
inserted
replaced
3511:6b61ba835964 | 3516:96780208dbd7 |
---|---|
931 CURLcode code; | 931 CURLcode code; |
932 long status = 0; | 932 long status = 0; |
933 | 933 |
934 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_WRITEDATA, &answer)); | 934 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_WRITEDATA, &answer)); |
935 | 935 |
936 const boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time(); | |
937 | |
936 if (boost::starts_with(url_, "https://")) | 938 if (boost::starts_with(url_, "https://")) |
937 { | 939 { |
938 code = OrthancHttpClientPerformSSL(pimpl_->curl_, &status); | 940 code = OrthancHttpClientPerformSSL(pimpl_->curl_, &status); |
939 } | 941 } |
940 else | 942 else |
941 { | 943 { |
942 code = GetHttpStatus(curl_easy_perform(pimpl_->curl_), pimpl_->curl_, &status); | 944 code = GetHttpStatus(curl_easy_perform(pimpl_->curl_), pimpl_->curl_, &status); |
943 } | 945 } |
944 | 946 |
945 LOG(INFO) << "HTTP status code " << status << " after " | 947 const boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time(); |
948 | |
949 LOG(INFO) << "HTTP status code " << status << " in " | |
950 << ((end - start).total_milliseconds()) << " ms after " | |
946 << EnumerationToString(method_) << " request on: " << url_; | 951 << EnumerationToString(method_) << " request on: " << url_; |
947 | 952 |
948 if (isVerbose_) | 953 if (isVerbose_) |
949 { | 954 { |
950 LOG(INFO) << "cURL status code: " << code; | 955 LOG(INFO) << "cURL status code: " << code; |