Add snabb get-state multiprocess support #961
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates snabb
get-state
to support multi-processes.Previously we just had all the state counters under
/softwire-state/
however in the new configuration (snabb-softwire-v2
), we have added state counters under each instance but left the global state counters intact as it were insnabb-softwire-v1
. The global counters now act as a summed aggregate of all the instances.This is achieved by adding a
process_states
function as part of the support which takes the states and provides one unified state structure. The generic case simply takes the first state data in the table (as before) but specific support functions can be written. The lwaftr's combines all the state data so we have a list of all the instances and then sums all the counters for/softwire-state/
.One important change which has occurred was previously
tables
(yang lists) were not supported in state.lua. I had to add support to go into the lists, this is done by providing the data (if available) when reading the state. This change had to be made in order to properly enumerate lists with their keys so you can see which key the state data belongs to.