1
0
Fork 0

added log option

This commit is contained in:
Frank Celler 2012-07-04 23:02:45 +02:00
parent 0b7c4ecee2
commit 84903ace48
6 changed files with 52 additions and 31 deletions

14
configure vendored
View File

@ -1513,7 +1513,8 @@ Optional Features:
--enable-zone-debug enables memory zone debugging (default: no)
--enable-logger enable logging and timing (default: yes)
--enable-timing enable timing (default: yes)
--enable-figures enable figures (default: yes)
--enable-figures enable figures, use 'yes', 'no', or 'hires'(default:
yes)
--disable-largefile omit support for large files
--enable-gcov enables gnu coverage (default: no)
--enable-curses enable ncurses support (default:
@ -5861,6 +5862,17 @@ cat >>confdefs.h <<_ACEOF
#define TRI_ENABLE_FIGURES 1
_ACEOF
elif test "x$tr_FIGURES" = xhires; then
cat >>confdefs.h <<_ACEOF
#define TRI_ENABLE_FIGURES 1
_ACEOF
cat >>confdefs.h <<_ACEOF
#define TRI_ENABLE_HIRES_FIGURES 1
_ACEOF
fi
if test "x$tr_FIGURES" = xyes; then

View File

@ -59,6 +59,12 @@
#undef TRI_ENABLE_FIGURES
////////////////////////////////////////////////////////////////////////////////
/// @brief enable hiresolution timer for figures
////////////////////////////////////////////////////////////////////////////////
#undef TRI_ENABLE_HIRES_FIGURES
////////////////////////////////////////////////////////////////////////////////
/// @brief enable logging
////////////////////////////////////////////////////////////////////////////////

View File

@ -67,15 +67,24 @@ using namespace std;
struct RequestStatisticsDesc {
RRF_DISTRIBUTION(RequestStatisticsDesc,
total,
(0.0001) << (0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0));
#ifdef TRI_ENABLE_HIRES_FIGURES
(0.0001) <<
#endif
(0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0));
RRF_DISTRIBUTION(RequestStatisticsDesc,
queue,
(0.0001) << (0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0));
#ifdef TRI_ENABLE_HIRES_FIGURES
(0.0001) <<
#endif
(0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0));
RRF_DISTRIBUTION(RequestStatisticsDesc,
request,
(0.0001) << (0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0));
#ifdef TRI_ENABLE_HIRES_FIGURES
(0.0001) <<
#endif
(0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0));
RRF_DISTRIBUTION(RequestStatisticsDesc,
bytesSent,

View File

@ -129,13 +129,14 @@ void TRI_UpdateRequestStatistics (double now);
#ifdef __cplusplus
triagens::basics::VariantArray* TRI_RequestStatistics (TRI_request_statistics_granularity_e granularity,
size_t limit,
bool showTotalTime,
bool showQueueTime,
bool showRequestTime,
bool showBytesSent,
bool showBytesReceived);
triagens::basics::VariantArray*
TRI_RequestStatistics (TRI_request_statistics_granularity_e granularity,
size_t limit,
bool showTotalTime,
bool showQueueTime,
bool showRequestTime,
bool showBytesSent,
bool showBytesReceived);
#endif

View File

@ -31,10 +31,6 @@
#include "BasicsC/threads.h"
#include "Statistics/request-statistics.h"
// #define TRI_USE_TIME_FIGURES 1
// #define TRI_USE_CLOCK_GETTIME_FIGURES 1
#define TRI_USE_THREAD_TIME 1
// -----------------------------------------------------------------------------
// --SECTION-- private variables
// -----------------------------------------------------------------------------
@ -122,7 +118,7 @@ static void StatisticsLoop (void* data) {
/// @brief gets the current wallclock time
////////////////////////////////////////////////////////////////////////////////
#ifdef TRI_USE_CLOCK_GETTIME_FIGURES
#ifdef TRI_ENABLE_HIRES_FIGURES
double TRI_StatisticsTime () {
struct timespec tp;
@ -132,22 +128,9 @@ double TRI_StatisticsTime () {
return tp.tv_sec + (tp.tv_nsec / 1000000000.0);
}
#endif
#else
#ifdef TRI_USE_TIME_FIGURES
double TRI_StatisticsTime () {
return time(NULL);
}
#endif
#ifdef TRI_USE_THREAD_TIME
double TRI_StatisticsTime () {
double result;
@ -158,6 +141,13 @@ double TRI_StatisticsTime () {
return result;
}
#else
double TRI_StatisticsTime () {
return time(NULL);
}
#endif
#endif
////////////////////////////////////////////////////////////////////////////////

View File

@ -39,13 +39,16 @@ dnl enable figures
dnl -----------------------------------------------------------------------------------------
AC_ARG_ENABLE(figures,
AS_HELP_STRING([--enable-figures], [enable figures (default: yes)]),
AS_HELP_STRING([--enable-figures], [enable figures, use 'yes', 'no', or 'hires'(default: yes)]),
[tr_FIGURES="$enableval"],
[tr_FIGURES="yes"]
)
if test "x$tr_FIGURES" = xyes; then
AC_DEFINE_UNQUOTED(TRI_ENABLE_FIGURES, 1, [true if figures are enabled])
elif test "x$tr_FIGURES" = xhires; then
AC_DEFINE_UNQUOTED(TRI_ENABLE_FIGURES, 1, [true if figures are enabled])
AC_DEFINE_UNQUOTED(TRI_ENABLE_HIRES_FIGURES, 1, [true if high resolution clock should be used])
fi
AM_CONDITIONAL(ENABLE_FIGURES, test "x$tr_FIGURES" = xyes)