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; --- 192 unchanged lines hidden (view full) --- 201{ 202 assert(id >= 0); 203 assert(id < m_nodes); 204 assert(m_endpoint_switches[id] != NULL); 205 return m_endpoint_switches[id]->getThrottles(); 206} 207 208void |
209SimpleNetwork::regStats() |
210{ |
211 m_msg_counts.resize(MessageSizeType_NUM); 212 m_msg_bytes.resize(MessageSizeType_NUM); |
213 |
214 for (MessageSizeType type = MessageSizeType_FIRST; 215 type < MessageSizeType_NUM; ++type) { 216 m_msg_counts[(unsigned int) type] 217 .name(name() + ".msg_count." + MessageSizeType_to_string(type)) 218 .flags(Stats::nozero) 219 ; 220 m_msg_bytes[(unsigned int) type] 221 .name(name() + ".msg_byte." + MessageSizeType_to_string(type)) 222 .flags(Stats::nozero) 223 ; |
224 |
225 // Now state what the formula is. 226 for (int i = 0; i < m_switches.size(); i++) { 227 m_msg_counts[(unsigned int) type] += 228 sum(m_switches[i]->getMsgCount(type)); |
229 } |
230 231 m_msg_bytes[(unsigned int) type] = 232 m_msg_counts[(unsigned int) type] * Stats::constant( 233 Network::MessageSizeType_to_int(type)); |
234 } |
235} 236 237void |
238SimpleNetwork::collateStats() |
239{ 240 for (int i = 0; i < m_switches.size(); i++) { |
241 m_switches[i]->collateStats(); |
242 } 243} 244 245void 246SimpleNetwork::print(ostream& out) const 247{ 248 out << "[SimpleNetwork]"; 249} --- 44 unchanged lines hidden --- |