Skip to content

Commit

Permalink
Optimize bulk counter to make the polling interval accurate
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <[email protected]>
  • Loading branch information
stephenxs committed Jan 8, 2025
1 parent 1684aec commit 44a3c65
Show file tree
Hide file tree
Showing 5 changed files with 665 additions and 48 deletions.
2 changes: 2 additions & 0 deletions lib/RedisRemoteSaiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ sai_status_t RedisRemoteSaiInterface::notifyCounterGroupOperations(
std::string key((const char*)flexCounterGroupParam->counter_group_name.list, flexCounterGroupParam->counter_group_name.count);

emplaceStrings(POLL_INTERVAL_FIELD, flexCounterGroupParam->poll_interval, entries);
emplaceStrings(BULK_CHUNK_SIZE_FIELD, flexCounterGroupParam->bulk_chunk_size, entries);
emplaceStrings(BULK_CHUNK_SIZE_PER_PREFIX_FIELD, flexCounterGroupParam->bulk_chunk_size_per_prefix, entries);
emplaceStrings(STATS_MODE_FIELD, flexCounterGroupParam->stats_mode, entries);
emplaceStrings(flexCounterGroupParam->plugin_name, flexCounterGroupParam->plugins, entries);
emplaceStrings(FLEX_COUNTER_STATUS_FIELD, flexCounterGroupParam->operation, entries);
Expand Down
14 changes: 14 additions & 0 deletions lib/sairedis.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ typedef struct _sai_redis_flex_counter_group_parameter_t
*/
sai_s8_list_t plugins;

/**
* @brief The bulk chunk size of the counter group
*
* It should be a number representing the bulk chunk size.
*/
sai_s8_list_t bulk_chunk_size;

/**
* @brief The bulk counter prefix map the counter group
*
* It should be a string representing bulk chunk size of each sub counter group.
*/
sai_s8_list_t bulk_chunk_size_per_prefix;

} sai_redis_flex_counter_group_parameter_t;

typedef struct _sai_redis_flex_counter_parameter_t
Expand Down
Loading

0 comments on commit 44a3c65

Please sign in to comment.