Switch.cc (11422:4f749e00b667) Switch.cc (11430:bd1c6789c33f)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

107{
108 assert(m_throttles[link_number] != NULL);
109 return m_throttles[link_number];
110}
111
112void
113Switch::regStats()
114{
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

107{
108 assert(m_throttles[link_number] != NULL);
109 return m_throttles[link_number];
110}
111
112void
113Switch::regStats()
114{
115 BasicRouter::regStats();
116
117 for (int link = 0; link < m_throttles.size(); link++) {
118 m_throttles[link]->regStats(name());
119 }
120
121 m_avg_utilization.name(name() + ".percent_links_utilized");
122 for (unsigned int i = 0; i < m_throttles.size(); i++) {
123 m_avg_utilization += m_throttles[i]->getUtilization();
124 }

--- 70 unchanged lines hidden ---
115 for (int link = 0; link < m_throttles.size(); link++) {
116 m_throttles[link]->regStats(name());
117 }
118
119 m_avg_utilization.name(name() + ".percent_links_utilized");
120 for (unsigned int i = 0; i < m_throttles.size(); i++) {
121 m_avg_utilization += m_throttles[i]->getUtilization();
122 }

--- 70 unchanged lines hidden ---