This fix adds sandesh systemlog message throttling support.
We are throttling the message on the send side with a circular
buffer of certail value. The size of the buffer would be the
messages/second that can be sent by the application.
If application sends more messages than the configured rate,
it will be dropped and a syslog message is recorded for each
overshoot.Following logic is added in the send part for both
c++ and python:
1. Record the current time in curr_time
2. If CB is full:
2.1. Compare time of the next free buffer with current time
2.2. If difference is more than a sec, then enque else drop
3. enqueue in CB
Currently the CB size cannot be changed midway
Partial-Bug: 1469414
Reviewed: https:/ /review. opencontrail. org/19170 github. org/Juniper/ contrail- sandesh/ commit/ 086e7917d976332 57845fd28c98ad8 e68c6c90cf
Committed: http://
Submitter: Zuul
Branch: R2.22.x
commit 086e7917d976332 57845fd28c98ad8 e68c6c90cf
Author: arvindvis <email address hidden>
Date: Tue Aug 18 15:45:54 2015 -0700
This fix adds sandesh systemlog message throttling support.
We are throttling the message on the send side with a circular
buffer of certail value. The size of the buffer would be the
messages/second that can be sent by the application.
If application sends more messages than the configured rate,
it will be dropped and a syslog message is recorded for each
overshoot.Following logic is added in the send part for both
c++ and python:
1. Record the current time in curr_time
2. If CB is full:
2.1. Compare time of the next free buffer with current time
2.2. If difference is more than a sec, then enque else drop
3. enqueue in CB
Currently the CB size cannot be changed midway
Partial-Bug: 1469414
Conflicts: generate/ t_cpp_generator .cc common/ sandesh. sandesh common/ sandesh_ uve.sandesh cpp/sandesh. cc cpp/sandesh. h cpp/sandesh_ statistics. cc cpp/test/ sandesh_ message_ test.cc python/ pysandesh/ sandesh_ stats.py
compiler/
library/
library/
library/
library/
library/
library/
library/
Change-Id: I2817ed643f1cd0 2ca916332c0d4f0 9e3f7b5f2c5