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 <ot@cisco.com>
This commit is contained in:

committed by
Andrew Yourtchenko

parent
a29d18ae6b
commit
233e468183
@ -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**
|
||||
|
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user