This is an automated email from the ASF dual-hosted git repository.
shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new b92b7e0 Fix event loop metrics to gather only from ET_NET threads.
b92b7e0 is described below
commit b92b7e002536648a8a079005a9757a77c08f5991
Author: Alan M. Carroll <[email protected]>
AuthorDate: Mon Jun 18 10:18:36 2018 -0500
Fix event loop metrics to gather only from ET_NET threads.
---
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 f96acf8..c95a97d 100644
--- a/iocore/eventsystem/I_EventProcessor.h
+++ b/iocore/eventsystem/I_EventProcessor.h
@@ -373,6 +373,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 68b7e5b..d2e86c7 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));