mirror of https://gitee.com/bigwinds/arangodb
added ignore for certain API calls (version & aardvark)
This commit is contained in:
parent
9596b7d9c0
commit
3db2475d1c
|
@ -107,6 +107,13 @@ std::string const& RestActionHandler::queue () const {
|
||||||
HttpHandler::status_t RestActionHandler::execute () {
|
HttpHandler::status_t RestActionHandler::execute () {
|
||||||
TRI_action_result_t result;
|
TRI_action_result_t result;
|
||||||
|
|
||||||
|
// check the request path
|
||||||
|
if (_request->databaseName() == "_system") {
|
||||||
|
if (TRI_IsPrefixString(_request->requestPath(), "/_admin/aardvark")) {
|
||||||
|
RequestStatisticsAgentSetIgnore(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// need an action
|
// need an action
|
||||||
if (_action == 0) {
|
if (_action == 0) {
|
||||||
generateNotImplemented(_request->requestPath());
|
generateNotImplemented(_request->requestPath());
|
||||||
|
|
|
@ -134,6 +134,8 @@ string const& RestVersionHandler::queue () const {
|
||||||
HttpHandler::status_t RestVersionHandler::execute () {
|
HttpHandler::status_t RestVersionHandler::execute () {
|
||||||
TRI_json_t result;
|
TRI_json_t result;
|
||||||
|
|
||||||
|
RequestStatisticsAgentSetIgnore(this);
|
||||||
|
|
||||||
TRI_InitArray2Json(TRI_CORE_MEM_ZONE, &result, 3);
|
TRI_InitArray2Json(TRI_CORE_MEM_ZONE, &result, 3);
|
||||||
|
|
||||||
TRI_json_t server;
|
TRI_json_t server;
|
||||||
|
|
|
@ -467,6 +467,28 @@ namespace triagens {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief sets ignore flag
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifdef TRI_ENABLE_FIGURES
|
||||||
|
|
||||||
|
#define RequestStatisticsAgentSetIgnore(a) \
|
||||||
|
do { \
|
||||||
|
if (TRI_ENABLE_STATISTICS) { \
|
||||||
|
if ((a)->RequestStatisticsAgent::_statistics != 0) { \
|
||||||
|
(a)->RequestStatisticsAgent::_statistics->_ignore = true; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
while (0)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define RequestStatisticsAgentSetIgnore(a) while (0)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief adds bytes received
|
/// @brief adds bytes received
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -97,29 +97,31 @@ TRI_request_statistics_t* TRI_AcquireRequestStatistics () {
|
||||||
void TRI_ReleaseRequestStatistics (TRI_request_statistics_t* statistics) {
|
void TRI_ReleaseRequestStatistics (TRI_request_statistics_t* statistics) {
|
||||||
STATISTICS_LOCK(&RequestListLock);
|
STATISTICS_LOCK(&RequestListLock);
|
||||||
|
|
||||||
TRI_TotalRequestsStatistics.incCounter();
|
if (! statistics->_ignore) {
|
||||||
|
TRI_TotalRequestsStatistics.incCounter();
|
||||||
|
|
||||||
if (statistics->_async) {
|
if (statistics->_async) {
|
||||||
TRI_AsyncRequestsStatistics.incCounter();
|
TRI_AsyncRequestsStatistics.incCounter();
|
||||||
}
|
|
||||||
|
|
||||||
TRI_MethodRequestsStatistics[(int) statistics->_requestType].incCounter();
|
|
||||||
|
|
||||||
// check the request was completely received and transmitted
|
|
||||||
if (statistics->_readStart != 0.0 && statistics->_writeEnd != 0.0) {
|
|
||||||
double totalTime = statistics->_writeEnd - statistics->_readStart;
|
|
||||||
TRI_TotalTimeDistributionStatistics->addFigure(totalTime);
|
|
||||||
|
|
||||||
double requestTime = statistics->_requestEnd - statistics->_requestStart;
|
|
||||||
TRI_RequestTimeDistributionStatistics->addFigure(requestTime);
|
|
||||||
|
|
||||||
if (statistics->_queueStart != 0.0 && statistics->_queueEnd != 0.0) {
|
|
||||||
double queueTime = statistics->_queueEnd - statistics->_queueStart;
|
|
||||||
TRI_QueueTimeDistributionStatistics->addFigure(queueTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRI_BytesSentDistributionStatistics->addFigure(statistics->_sentBytes);
|
TRI_MethodRequestsStatistics[(int) statistics->_requestType].incCounter();
|
||||||
TRI_BytesReceivedDistributionStatistics->addFigure(statistics->_receivedBytes);
|
|
||||||
|
// check the request was completely received and transmitted
|
||||||
|
if (statistics->_readStart != 0.0 && statistics->_writeEnd != 0.0) {
|
||||||
|
double totalTime = statistics->_writeEnd - statistics->_readStart;
|
||||||
|
TRI_TotalTimeDistributionStatistics->addFigure(totalTime);
|
||||||
|
|
||||||
|
double requestTime = statistics->_requestEnd - statistics->_requestStart;
|
||||||
|
TRI_RequestTimeDistributionStatistics->addFigure(requestTime);
|
||||||
|
|
||||||
|
if (statistics->_queueStart != 0.0 && statistics->_queueEnd != 0.0) {
|
||||||
|
double queueTime = statistics->_queueEnd - statistics->_queueStart;
|
||||||
|
TRI_QueueTimeDistributionStatistics->addFigure(queueTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
TRI_BytesSentDistributionStatistics->addFigure(statistics->_sentBytes);
|
||||||
|
TRI_BytesReceivedDistributionStatistics->addFigure(statistics->_receivedBytes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear statistics and put back an the free list
|
// clear statistics and put back an the free list
|
||||||
|
|
|
@ -63,23 +63,24 @@ TRI_statistics_list_t;
|
||||||
typedef struct TRI_request_statistics_s {
|
typedef struct TRI_request_statistics_s {
|
||||||
void* _next;
|
void* _next;
|
||||||
|
|
||||||
double _readStart;
|
double _readStart;
|
||||||
double _readEnd;
|
double _readEnd;
|
||||||
double _queueStart;
|
double _queueStart;
|
||||||
double _queueEnd;
|
double _queueEnd;
|
||||||
double _requestStart;
|
double _requestStart;
|
||||||
double _requestEnd;
|
double _requestEnd;
|
||||||
double _writeStart;
|
double _writeStart;
|
||||||
double _writeEnd;
|
double _writeEnd;
|
||||||
|
|
||||||
double _receivedBytes;
|
double _receivedBytes;
|
||||||
double _sentBytes;
|
double _sentBytes;
|
||||||
|
|
||||||
triagens::rest::HttpRequest::HttpRequestType _requestType;
|
triagens::rest::HttpRequest::HttpRequestType _requestType;
|
||||||
|
|
||||||
bool _async;
|
bool _async;
|
||||||
bool _tooLarge;
|
bool _tooLarge;
|
||||||
bool _executeError;
|
bool _executeError;
|
||||||
|
bool _ignore;
|
||||||
}
|
}
|
||||||
TRI_request_statistics_t;
|
TRI_request_statistics_t;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue