1
0
Fork 0

added ignore for certain API calls (version & aardvark)

This commit is contained in:
Frank Celler 2014-05-04 12:46:29 +02:00
parent 9596b7d9c0
commit 3db2475d1c
5 changed files with 67 additions and 33 deletions

View File

@ -107,6 +107,13 @@ std::string const& RestActionHandler::queue () const {
HttpHandler::status_t RestActionHandler::execute () {
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
if (_action == 0) {
generateNotImplemented(_request->requestPath());

View File

@ -134,6 +134,8 @@ string const& RestVersionHandler::queue () const {
HttpHandler::status_t RestVersionHandler::execute () {
TRI_json_t result;
RequestStatisticsAgentSetIgnore(this);
TRI_InitArray2Json(TRI_CORE_MEM_ZONE, &result, 3);
TRI_json_t server;

View File

@ -467,6 +467,28 @@ namespace triagens {
#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
////////////////////////////////////////////////////////////////////////////////

View File

@ -97,6 +97,7 @@ TRI_request_statistics_t* TRI_AcquireRequestStatistics () {
void TRI_ReleaseRequestStatistics (TRI_request_statistics_t* statistics) {
STATISTICS_LOCK(&RequestListLock);
if (! statistics->_ignore) {
TRI_TotalRequestsStatistics.incCounter();
if (statistics->_async) {
@ -121,6 +122,7 @@ void TRI_ReleaseRequestStatistics (TRI_request_statistics_t* statistics) {
TRI_BytesSentDistributionStatistics->addFigure(statistics->_sentBytes);
TRI_BytesReceivedDistributionStatistics->addFigure(statistics->_receivedBytes);
}
}
// clear statistics and put back an the free list
memset(statistics, 0, sizeof(TRI_request_statistics_t));

View File

@ -80,6 +80,7 @@ typedef struct TRI_request_statistics_s {
bool _async;
bool _tooLarge;
bool _executeError;
bool _ignore;
}
TRI_request_statistics_t;