20 #define RATESMONITOR_SELFMSG "RMT_MonitorPolicy_PortsLoad"
27 #ifdef PORTSLOADMONITOR_ENHANCED_DEBUG
28 void PortsLoadMonitor::enhancedDebug()
32 cModule * ipcm = check_and_cast<cModule *>(getModuleByPath(
"^.^.^"));
33 cDisplayString & cs = ipcm->getDisplayString();
34 std::ostringstream str;
38 str << i->first->info() <<
", " << i->second <<
"\n";
41 cs.setTagArg(
"t", 1,
"l");
42 cs.setTagArg(
"t", 0, str.str().c_str());
64 if(msg->isSelfMessage())
70 rates[i->first] = i->second;
74 #ifdef PORTSLOADMONITOR_ENHANCED_DEBUG
91 EV <<
"[Rate monitor policy] ERROR: "
92 "No RMT allocator detected.";
101 EV <<
"[Rate monitor policy] ERROR: "
102 "Could not resolve the queue.";
109 acc[port] += pdu->getByteLength();
111 #ifdef PORTSLOADMONITOR_ENHANCED_DEBUG
124 EV <<
"[Rate monitor policy] ERROR: "
125 "No RMT allocator detected.";
134 EV <<
"[Rate monitor policy] ERROR: "
135 "Could not resolve the queue.";
142 acc[port] += pdu->getByteLength();
144 #ifdef PORTSLOADMONITOR_ENHANCED_DEBUG
153 getModuleByPath(
"^.allocator"));
const cPacket * getFirstPDU() const
virtual void onPolicyInit()
PortsMap::iterator PMIter
Define_Module(PortsLoadMonitor)
RMTPort * getQueueToPortMapping(RMTQueue *queue)
virtual void postPDUInsertion(RMTQueue *queue)
#define RATESMONITOR_SELFMSG
RMTModuleAllocator * rmtA
const cPacket * getLastPDU() const
virtual void prePDURelease(RMTQueue *queue)
int64_t getByteRate(RMTPort *port)
virtual void handleMessage(cMessage *msg)