Throttle.cc (6285:ce086eca1ede) Throttle.cc (6288:083a6806dd96)
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 190 unchanged lines hidden (view full) ---

199 int bw_used = getLinkBandwidth()-bw_remaining;
200 m_bandwidth_since_sample += bw_used;
201
202 // FIXME - comment out the bash specific code for faster performance
203 // Start Bash code
204 // Update the predictor
205 Time current_time = g_eventQueue_ptr->getTime();
206 while ((current_time - m_last_bandwidth_sample) > ADJUST_INTERVAL) {
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 190 unchanged lines hidden (view full) ---

199 int bw_used = getLinkBandwidth()-bw_remaining;
200 m_bandwidth_since_sample += bw_used;
201
202 // FIXME - comment out the bash specific code for faster performance
203 // Start Bash code
204 // Update the predictor
205 Time current_time = g_eventQueue_ptr->getTime();
206 while ((current_time - m_last_bandwidth_sample) > ADJUST_INTERVAL) {
207 double utilization = m_bandwidth_since_sample/double(ADJUST_INTERVAL * getLinkBandwidth());
208
209 // Used less bandwidth
210 m_bash_counter--;
211
212 // Make sure we don't overflow
213 m_bash_counter = min(HIGH_RANGE, m_bash_counter);
214 m_bash_counter = max(0, m_bash_counter);
215
216 // Reset samples

--- 70 unchanged lines hidden ---
207 // Used less bandwidth
208 m_bash_counter--;
209
210 // Make sure we don't overflow
211 m_bash_counter = min(HIGH_RANGE, m_bash_counter);
212 m_bash_counter = max(0, m_bash_counter);
213
214 // Reset samples

--- 70 unchanged lines hidden ---