浏览代码

HPCC-16590 UDP stats reporting config option

Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>
Mark Kelly 8 年之前
父节点
当前提交
aade8466aa

+ 2 - 0
initfiles/etc/DIR_NAME/environment.conf.in

@@ -22,6 +22,8 @@ interface=*
 use_epoll=true
 # allow kernel pagecache flushing where enabled (true/false)
 allow_pgcache_flush=true
+# report UDP network stats
+udp_stats=true
 mpStart=7101
 mpEnd=7500
 mpSoMaxConn=128

+ 1 - 0
initfiles/etc/DIR_NAME/environment.xml.in

@@ -788,6 +788,7 @@
   <log>${LOG_PATH}</log>
   <logfields>TIM+DAT+MLT+MID+PID+TID+COD+QUO+PFX</logfields>
   <use_epoll>true</use_epoll>
+  <udp_stats>true</udp_stats>
   <runtime>${RUNTIME_PATH}</runtime>
   <lock>${LOCK_PATH}</lock>
   <configs>${CONFIG_DIR}</configs>

+ 5 - 0
system/jlib/jdebug.cpp

@@ -55,6 +55,7 @@
  #include <mach/task.h>
  #include <mach/mach_init.h>
 #endif
+#include "build-config.h"
 
 //===========================================================================
 #ifdef _DEBUG
@@ -2312,6 +2313,10 @@ public:
         hook = _hook;
         term = false;
         latestCPU = 0;
+        // UDP stats reported unless explicitly disabled
+        Owned<IProperties> conf = createProperties(CONFIG_DIR PATHSEPSTR "environment.conf", true);
+        if (conf->getPropBool("udp_stats", true))
+            traceMode |= PerfMonUDP;
 #ifdef _WIN32
         memset(&liOldIdleTime,0,sizeof(liOldIdleTime));
         memset(&liOldSystemTime,0,sizeof(liOldSystemTime));

+ 1 - 1
system/jlib/jdebug.hpp

@@ -304,7 +304,7 @@ enum
 #ifdef _WIN32
     PerfMonStandard  = PerfMonProcMem
 #else
-    PerfMonStandard  = PerfMonProcMem|PerfMonExtended|PerfMonUDP
+    PerfMonStandard  = PerfMonProcMem|PerfMonExtended
 #endif
 
 };

+ 1 - 0
testing/regress/environment.xml.in

@@ -779,6 +779,7 @@
   <log>${LOG_PATH}</log>
   <logfields>TIM+DAT+MLT+MID+PID+TID+COD+QUO+PFX</logfields>
   <use_epoll>true</use_epoll>
+  <udp_stats>true</udp_stats>
   <runtime>${RUNTIME_PATH}</runtime>
   <lock>${LOCK_PATH}</lock>
   <configs>${CONFIG_DIR}</configs>