Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

BoxStatsSample.h

Go to the documentation of this file.
00001 #ifndef BOXSTATSSAMPLE_H 00002 #define BOXSTATSSAMPLE_H 00003 00004 #include<vector> 00005 #include<sstream> 00006 00007 using namespace std; 00008 00015 struct BoxStatsSample { 00016 BoxStatsSample(unsigned long tv_sec, 00017 size_t tuplesConsumed, 00018 const vector<size_t> tuplesProduced) : 00019 _tv_sec(tv_sec), 00020 _tuplesConsumed(tuplesConsumed), 00021 _tuplesProduced(tuplesProduced) 00022 { 00023 } 00024 00025 // This is intended to correspond to the timeval._tv_sec field that gets 00026 // filled in by a call to gettimeofday(...). 00027 long _tv_sec; 00028 00029 // The total number of tuples consumed, from all streams entering the 00030 // box, during this sample. 00031 size_t _tuplesConsumed; 00032 00033 // For each output port, this gives the total number of tuples emitted 00034 // by this box during this sample. Elements in this vector correspond 00035 // to elements in the QBox::_inq vector, on a per-index basis. 00036 vector<size_t> _tuplesProduced; 00037 00038 string to_string() const { 00039 ostringstream os; 00040 os << "_tv_sec = " << _tv_sec << endl 00041 << "_tuplesConsumed = " << _tuplesConsumed << endl; 00042 00043 for (vector<size_t>::size_type i = 0; i < _tuplesProduced.size(); ++i) { 00044 os << "_tuplesProduced[" << i << "] = " << _tuplesProduced[i] << endl; 00045 } 00046 00047 return os.str(); 00048 } 00049 }; 00050 00051 #endif

Generated on Fri Nov 12 15:15:20 2004 for Borealis by doxygen 1.3.8