2 id: channel-switch-timer
5 The _switch timer_ period is another important configurable feature of
6 channels to ensure periodic sub-buffer flushing.
8 When the _switch timer_ fires, a sub-buffer switch happens. This timer
9 may be used to ensure that event data is consumed and committed to
10 trace files periodically in case of a low event throughput:
12 <script type="text/javascript">
13 document.write('<div class="img img-50" id="docsvg-channel-switch-timer"></div>');
15 $(document).ready(function() {
16 var doc = SVG('docsvg-channel-switch-timer');
18 doc.viewbox(0, 0, 2, 2);
22 var rb = rbBuildStd(doc, div, 0.97);
23 var switchText = doc.text('Switch!');
29 switchText.center(1, 1);
37 var onEventAdded = function() {
40 var curSubBufEvCount = rb.getSubBufEvCount(curSubBuf % div);
42 if (totalEvents >= 4) {
47 switchText.animate(500, '<>', 1000).attr({
50 rb.markSubBuf(curSubBuf % div, 'full');
52 var lastFullSubBuf = curSubBuf;
54 setTimeout(function() {
55 rb.consumeSubBuf(lastFullSubBuf % div);
59 rb.markSubBuf(curSubBuf % div, 'cur');
62 rb.addEvent(curSubBuf % div, evDur, onEventAdded);
65 rb.addEvent(0, evDur, onEventAdded);
66 rb.markSubBuf(0, 'cur');
68 rb.getGroup().move(1, 1);
75 <span class="t">Oops!</span>JavaScript must be enabled in
76 order to view animations.
81 It's also convenient when big sub-buffers are used to cope with
82 sporadic high event throughput, even if the throughput is normally