Comment 53 for bug 1469414

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/19150
Committed: http://github.org/Juniper/contrail-sandesh/commit/b8c702a89d13881e93b9e215ae35853216b039d7
Submitter: Zuul
Branch: R2.21.x

commit b8c702a89d13881e93b9e215ae35853216b039d7
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:
 library/common/sandesh.sandesh
 library/common/sandesh_uve.sandesh
 library/cpp/sandesh_statistics.cc
 library/cpp/test/sandesh_message_test.cc
 library/python/pysandesh/sandesh_stats.py

Change-Id: I2817ed643f1cd02ca916332c0d4f09e3f7b5f2c5