diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-06-14 18:12:57 +0100 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2012-06-15 13:35:00 -0300 |
commit | afeecec2e8e99ba184c487633d5d0dde68a002ac (patch) | |
tree | 684e8964ba4d983d23841760b45de6661fb3309e /qtest.c | |
parent | 973603a813c5d60534b4fa0313f83be40e2b9c47 (diff) |
Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events
Allow certain event types to be rate limited to avoid flooding
monitor clients. The monitor_protocol_event() method is changed
such that instead of immediately emitting the event to Monitor
instances, it will call a new monitor_protocol_event_queue()
method.
This will check to see if the rate limit for the event has been
exceeded, and if so schedule a timer to wakeup at the end of the
rate limit period. If further events arrive before the timer fires,
the previously queued event will be discarded in favour of the new
event. The event will eventually be emitted when the timer fires.
This logic is applied to RTC_CHANGE, BALLOON_CHANGE & WATCHDOG
events, since the data associated with these events is stateless
* monitor.c: Add support for rate limiting
* monitor.h: Define monitor_global_init for one-time setup tasks
* vl.c: Invoke monitor_global_init
* trace-events: Add hooks for monitor event tracing
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qtest.c')
0 files changed, 0 insertions, 0 deletions