Comment 36 for bug 1469414

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

Reviewed: https://review.opencontrail.org/19053
Committed: http://github.org/Juniper/contrail-sandesh/commit/6ef149a85d24c5b55cbd7885065f6220c63d3588
Submitter: Zuul
Branch: R2.20

commit 6ef149a85d24c5b55cbd7885065f6220c63d3588
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:
 compiler/generate/t_cpp_generator.cc
 library/common/sandesh.sandesh
 library/common/sandesh_uve.sandesh
 library/cpp/sandesh.cc
 library/cpp/sandesh.h
 library/cpp/sandesh_statistics.cc
 library/cpp/test/sandesh_message_test.cc
 library/python/pysandesh/sandesh_stats.py

Change-Id: I2817ed643f1cd02ca916332c0d4f09e3f7b5f2c5