Skip to content

Commit

Permalink
fixed #203 cpustats searchd cli option to work with unsupported systems
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatolog committed Feb 27, 2018
1 parent 8740fd6 commit ce528f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Expand Up @@ -132,7 +132,7 @@ The options available to ``searchd`` on all builds are:
- ``--cpustats`` is used to provide actual CPU time report (in addition
to wall time) in both query log file (for every given query) and
status report (aggregated). It depends on clock_gettime() system
call and might therefore be unavailable on certain systems. You might
call or fall back to less precise call on certain systems. You might
start ``searchd`` thus:

.. code-block:: bash
Expand Down
6 changes: 1 addition & 5 deletions src/searchd.cpp
Expand Up @@ -6979,7 +6979,7 @@ int64_t sphCpuTimer ()

return tp.tv_sec*1000000 + tp.tv_nsec/1000;
#else
return 0;
return sphMicroTimer();
#endif
}

Expand Down Expand Up @@ -20331,9 +20331,7 @@ void ShowHelp ()
"--status\t\tget ant print status variables\n"
"\t\t\t(PID is taken from pid_file specified in config file)\n"
"--iostats\t\tlog per-query io stats\n"
#ifdef HAVE_CLOCK_GETTIME
"--cpustats\t\tlog per-query cpu stats\n"
#endif
#if USE_WINDOWS
"--install\t\tinstall as Windows service\n"
"--delete\t\tdelete Windows service\n"
Expand Down Expand Up @@ -23650,9 +23648,7 @@ int WINAPI ServiceMain ( int argc, char **argv )
OPT1 ( "--status" ) bOptStatus = true;
OPT1 ( "--pidfile" ) bOptPIDFile = true;
OPT1 ( "--iostats" ) g_bIOStats = true;
#if !USE_WINDOWS
OPT1 ( "--cpustats" ) g_bCpuStats = true;
#endif
#if USE_WINDOWS
OPT1 ( "--install" ) { if ( !g_bService ) { ServiceInstall ( argc, argv ); return 0; } }
OPT1 ( "--delete" ) { if ( !g_bService ) { ServiceDelete (); return 0; } }
Expand Down

0 comments on commit ce528f3

Please sign in to comment.