This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit c66c16cd7eca709ab69978681ecbc7aaed81b72b
Author: Alan M. Carroll <a...@apache.org>
AuthorDate: Mon Jun 18 10:18:36 2018 -0500

    Fix event loop metrics to gather only from ET_NET threads.
    
    (cherry picked from commit b92b7e002536648a8a079005a9757a77c08f5991)
---
 iocore/eventsystem/I_EventProcessor.h    | 7 +++++++
 iocore/eventsystem/UnixEventProcessor.cc | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/iocore/eventsystem/I_EventProcessor.h 
b/iocore/eventsystem/I_EventProcessor.h
index 02b665f..f85a0c5 100644
--- a/iocore/eventsystem/I_EventProcessor.h
+++ b/iocore/eventsystem/I_EventProcessor.h
@@ -372,6 +372,13 @@ public:
     return {all_dthreads, n_dthreads};
   }
 
+  active_threads_type
+  active_group_threads(int type) const
+  {
+    ThreadGroupDescriptor const &group{thread_group[type]};
+    return {group._thread, group._count};
+  }
+
 private:
   void initThreadState(EThread *);
 
diff --git a/iocore/eventsystem/UnixEventProcessor.cc 
b/iocore/eventsystem/UnixEventProcessor.cc
index b44c632..74ec302 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -79,8 +79,8 @@ EventMetricStatSync(const char *, RecDataT, RecData *, 
RecRawStatBlock *rsb, int
   EThread::EventMetrics summary[EThread::N_EVENT_TIMESCALES];
 
   // scan the thread local values
-  for (int i = 0; i < eventProcessor.n_ethreads; ++i) {
-    eventProcessor.all_ethreads[i]->summarize_stats(summary);
+  for (EThread *t : eventProcessor.active_group_threads(ET_CALL)) {
+    t->summarize_stats(summary);
   }
 
   ink_mutex_acquire(&(rsb->mutex));

Reply via email to