#include "sink.h" // Module registration: Define_Module( Sink ); void Sink::activity() { // reset statistics sInfo.clearResult(); totalCount = 0; // get number of samples to record int sampleCount = par("sample_count"); // file to write history to cOutVector srt("system response time", 1); // message loop for(int i = 0; itimestamp(); sInfo.collect(msrt); srt.record(msrt); // delete msg delete msg; } endSimulation(); } void Sink::finish() { ev << "Total jobs processed: " << totalCount + sInfo.samples() << endl; ev << "Number of jobs used for statistics: " << sInfo.samples() << endl; ev << "Avg system response time: " << sInfo.mean() << endl; ev << "Standard deviation: " << sInfo.stddev() << endl; ev << "Max system response time: " << sInfo.max() << endl; ev << "Min system response time: " << sInfo.min() << endl; ev << endl; } void Sink::reset() { // update totalCount totalCount += sInfo.samples(); sInfo.clearResult(); }