From 233e4681830bc2a9cd40deb4b5909b4e310d1a2a Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 16 May 2019 15:01:34 +0200 Subject: stats: support multiple works for error counters The current code only allowed access to the main thread error counters. That is not so useful for a multi worker instance. No return a vector indexed by thread of counter_t values. Type: fix Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7 Signed-off-by: Ole Troan --- extras/vom/vom/stat_client.cpp | 6 +++--- extras/vom/vom/stat_client.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'extras') diff --git a/extras/vom/vom/stat_client.cpp b/extras/vom/vom/stat_client.cpp index a413d6763f0..394c6eeee96 100644 --- a/extras/vom/vom/stat_client.cpp +++ b/extras/vom/vom/stat_client.cpp @@ -32,7 +32,7 @@ stat_client::stat_data_t::stat_data_t(const stat_segment_data_t& stat_seg_data) m_combined_counter_vec = stat_seg_data.combined_counter_vec; break; case STAT_DIR_TYPE_ERROR_INDEX: - m_error_value = stat_seg_data.error_value; + m_error_vec = stat_seg_data.error_vector; break; case STAT_DIR_TYPE_NAME_VECTOR: break; @@ -59,10 +59,10 @@ stat_client::stat_data_t::get_stat_segment_scalar_data() const return m_scalar_value; } -uint64_t +uint64_t* stat_client::stat_data_t::get_stat_segment_error_data() const { - return m_error_value; + return m_error_vec; } uint64_t** diff --git a/extras/vom/vom/stat_client.hpp b/extras/vom/vom/stat_client.hpp index 8e014da19b1..f1745c87b20 100644 --- a/extras/vom/vom/stat_client.hpp +++ b/extras/vom/vom/stat_client.hpp @@ -56,7 +56,7 @@ public: * Get pointer to actual data */ double get_stat_segment_scalar_data() const; - uint64_t get_stat_segment_error_data() const; + uint64_t* get_stat_segment_error_data() const; uint64_t** get_stat_segment_simple_counter_data() const; vlib_counter_t** get_stat_segment_combined_counter_data() const; @@ -77,7 +77,7 @@ public: union { double m_scalar_value; - uint64_t m_error_value; + counter_t* m_error_vec; counter_t** m_simple_counter_vec; vlib_counter_t** m_combined_counter_vec; }; -- cgit 1.2.3-korg