Lines Matching full:windows
36 * - Create two windows with a certain expiration period, and
38 * - Each time you want to account a new value, do it in both windows.
90 return &ta->windows[ta->current]; in current_window()
113 window_reset(&ta->windows[0]); in timed_average_init()
114 window_reset(&ta->windows[1]); in timed_average_init()
116 /* Both windows are offsetted by half a period */ in timed_average_init()
117 ta->windows[0].expiration = now + ta->period / 2; in timed_average_init()
118 ta->windows[1].expiration = now + ta->period; in timed_average_init()
121 /* Check if the time windows have expired, updating their counters and
135 /* Check if the windows have expired */ in check_expirations()
137 TimedAverageWindow *w = &ta->windows[i]; in check_expirations()
145 if (ta->windows[0].expiration < ta->windows[1].expiration) { in check_expirations()
153 int64_t remaining = ta->windows[ta->current].expiration - now; in check_expirations()
168 /* Do the accounting in both windows at the same time */ in timed_average_account()
170 TimedAverageWindow *w = &ta->windows[i]; in timed_average_account()