Review fixes.
This commit is contained in:
parent
170923874b
commit
045d25041f
@ -9,6 +9,7 @@
|
|||||||
#include "util/simple_logger.hpp"
|
#include "util/simple_logger.hpp"
|
||||||
#include "util/string_util.hpp"
|
#include "util/string_util.hpp"
|
||||||
#include "util/typedefs.hpp"
|
#include "util/typedefs.hpp"
|
||||||
|
#include "util/timing_util.hpp"
|
||||||
|
|
||||||
#include "engine/status.hpp"
|
#include "engine/status.hpp"
|
||||||
#include "osrm/osrm.hpp"
|
#include "osrm/osrm.hpp"
|
||||||
@ -48,8 +49,7 @@ void RequestHandler::HandleRequest(const http::request ¤t_request, http::r
|
|||||||
// parse command
|
// parse command
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::chrono::time_point<std::chrono::system_clock> start, end;
|
TIMER_START(request_duration);
|
||||||
start = std::chrono::system_clock::now();
|
|
||||||
std::string request_string;
|
std::string request_string;
|
||||||
util::URIDecode(current_request.uri, request_string);
|
util::URIDecode(current_request.uri, request_string);
|
||||||
util::SimpleLogger().Write(logDEBUG) << "req: " << request_string;
|
util::SimpleLogger().Write(logDEBUG) << "req: " << request_string;
|
||||||
@ -135,11 +135,9 @@ void RequestHandler::HandleRequest(const http::request ¤t_request, http::r
|
|||||||
|
|
||||||
time_t ltime;
|
time_t ltime;
|
||||||
struct tm *time_stamp;
|
struct tm *time_stamp;
|
||||||
|
TIMER_STOP(request_duration);
|
||||||
|
|
||||||
end = std::chrono::system_clock::now();
|
ltime = time(nullptr);
|
||||||
std::chrono::duration<double> elapsed_seconds = end - start;
|
|
||||||
|
|
||||||
ltime = std::chrono::system_clock::to_time_t(end);
|
|
||||||
time_stamp = localtime(<ime);
|
time_stamp = localtime(<ime);
|
||||||
// log timestamp
|
// log timestamp
|
||||||
util::SimpleLogger().Write()
|
util::SimpleLogger().Write()
|
||||||
@ -149,7 +147,7 @@ void RequestHandler::HandleRequest(const http::request ¤t_request, http::r
|
|||||||
<< time_stamp->tm_hour << ":" << (time_stamp->tm_min < 10 ? "0" : "")
|
<< time_stamp->tm_hour << ":" << (time_stamp->tm_min < 10 ? "0" : "")
|
||||||
<< time_stamp->tm_min << ":" << (time_stamp->tm_sec < 10 ? "0" : "")
|
<< time_stamp->tm_min << ":" << (time_stamp->tm_sec < 10 ? "0" : "")
|
||||||
<< time_stamp->tm_sec << " "
|
<< time_stamp->tm_sec << " "
|
||||||
<< elapsed_seconds.count() * 1000.0 << "ms " << current_request.endpoint.to_string() << " "
|
<< TIMER_MSEC(request_duration) << "ms " << current_request.endpoint.to_string() << " "
|
||||||
<< current_request.referrer << (0 == current_request.referrer.length() ? "- " : " ")
|
<< current_request.referrer << (0 == current_request.referrer.length() ? "- " : " ")
|
||||||
<< current_request.agent << (0 == current_request.agent.length() ? "- " : " ")
|
<< current_request.agent << (0 == current_request.agent.length() ? "- " : " ")
|
||||||
<< current_reply.status << " " //
|
<< current_reply.status << " " //
|
||||||
|
Loading…
Reference in New Issue
Block a user