1
0
Fork 0

better log facilities for debugging statistics

This commit is contained in:
Jan Christoph Uhde 2016-11-22 16:18:39 +01:00
parent c1db7228c7
commit 1f29e2de81
2 changed files with 55 additions and 21 deletions

View File

@ -40,6 +40,59 @@ thread_local TRI_request_statistics_t* TRI_request_statistics_t::STATS =
static size_t const QUEUE_SIZE = 1000;
std::string TRI_request_statistics_t::to_string(){
std::stringstream ss;
ss << std::boolalpha << std::setprecision(20) << "statistics "
<< std::endl
<< "_readStart " << _readStart << std::endl
<< "_readEnd " << _readEnd << std::endl
<< "_queueStart " << _queueStart << std::endl
<< "_queueEnd " << _queueEnd << std::endl
<< "_requestStart " << _requestStart << std::endl
<< "_requestEnd " << _requestEnd << std::endl
<< "_writeStart " << _writeStart << std::endl
<< "_writeEnd " << _writeEnd << std::endl
<< "_receivedBytes " << _receivedBytes << std::endl
<< "_sentBytes " << _sentBytes << std::endl
<< "_async " << _async << std::endl
<< "_tooLarge " << _tooLarge << std::endl
<< "_executeError " << _executeError << std::endl
<< "_ignore " << _ignore << std::endl;
return ss.str();
}
void TRI_request_statistics_t::trace_log(){
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_readStart " << _readStart;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_readEnd " << _readEnd;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_queueStart " << _queueStart;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_queueEnd " << _queueEnd;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_requestStart " << _requestStart;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_requestEnd " << _requestEnd;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_writeStart " << _writeStart;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_writeEnd " << _writeEnd;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_receivedBytes " << _receivedBytes;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_sentBytes " << _sentBytes;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_async " << _async;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_tooLarge " << _tooLarge;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_executeError " << _executeError;
LOG_TOPIC(TRACE, Logger::REQUESTS) << std::boolalpha << std::setprecision(20)
<< "_ignore " << _ignore;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief lock for request statistics data
////////////////////////////////////////////////////////////////////////////////

View File

@ -80,27 +80,8 @@ struct TRI_request_statistics_t {
#endif
}
std::string to_string() {
std::stringstream ss;
ss << std::boolalpha << std::setprecision(20) << "statistics "
<< std::endl
<< "_readStart " << _readStart << std::endl
<< "_readEnd " << _readEnd << std::endl
<< "_queueStart " << _queueStart << std::endl
<< "_queueEnd " << _queueEnd << std::endl
<< "_requestStart " << _requestStart << std::endl
<< "_requestEnd " << _requestEnd << std::endl
<< "_writeStart " << _writeStart << std::endl
<< "_writeEnd " << _writeEnd << std::endl
<< "_receivedBytes " << _receivedBytes << std::endl
<< "_sentBytes " << _sentBytes << std::endl
<< "_async " << _async << std::endl
<< "_tooLarge " << _tooLarge << std::endl
<< "_executeError " << _executeError << std::endl
<< "_ignore " << _ignore << std::endl;
return ss.str();
}
std::string to_string();
void trace_log();
double _readStart; // CommTask::processRead - read first byte of message
double _readEnd; // CommTask::processRead - message complete