CMS 3D CMS Logo

Public Member Functions | Public Attributes

evf::iDie::commonLsStat Class Reference

List of all members.

Public Member Functions

 commonLsStat (unsigned int lsid, unsigned int classes)
float getBusyTotalFrac (bool procstat, std::vector< float > &machineWeightInst)
float getBusyTotalFracTheor (bool procstat, std::vector< float > &machineWeight)
unsigned int getNReports ()
unsigned int getTotalRate ()
std::string printInfo ()
void setBusyForClass (unsigned int classIdx, unsigned int rate, float busy, float busyTheor, float busyCPU, float busyCPUTheor, unsigned int nMachineReports)

Public Attributes

std::vector< float > busyCPUVec_
std::vector< float > busyCPUVecTheor_
std::vector< float > busyVec_
std::vector< float > busyVecTheor_
unsigned int ls_
std::vector< unsigned int > nbMachines
std::vector< unsigned int > rateVec_

Detailed Description

Definition at line 224 of file iDie.h.


Constructor & Destructor Documentation

evf::iDie::commonLsStat::commonLsStat ( unsigned int  lsid,
unsigned int  classes 
) [inline]

Definition at line 234 of file iDie.h.

References busyCPUVec_, busyCPUVecTheor_, busyVec_, busyVecTheor_, i, ls_, nbMachines, and rateVec_.

                                                           {
        for (size_t i=0;i<classes;i++) {
          rateVec_.push_back(0.);
          busyVec_.push_back(0.);
          busyCPUVec_.push_back(0.);
          busyVecTheor_.push_back(0.);
          busyCPUVecTheor_.push_back(0.);
          nbMachines.push_back(0);
        }
        ls_=lsid;
      }

Member Function Documentation

float evf::iDie::commonLsStat::getBusyTotalFrac ( bool  procstat,
std::vector< float > &  machineWeightInst 
) [inline]

Definition at line 260 of file iDie.h.

References busyCPUVec_, busyVec_, i, and nbMachines.

Referenced by evf::iDie::updateRollingHistos().

                                                                                 {
        double sum=0;
        double sumMachines=0;
        for (size_t i=0;i<busyVec_.size();i++) {
          if (!procstat)
            sum+=machineWeightInst[i]*nbMachines.at(i)*busyVec_[i];
          else
            sum+=machineWeightInst[i]*nbMachines.at(i)*busyCPUVec_[i];
          sumMachines+=machineWeightInst[i]*nbMachines.at(i);
        }
        if (sumMachines>0)
          return float(sum/sumMachines);
        else return 0.;
      }
float evf::iDie::commonLsStat::getBusyTotalFracTheor ( bool  procstat,
std::vector< float > &  machineWeight 
) [inline]

Definition at line 275 of file iDie.h.

References busyCPUVecTheor_, busyVecTheor_, i, and nbMachines.

Referenced by evf::iDie::updateRollingHistos().

                                                                                  {
        float sum=0;
        float sumMachines=0;
        for (size_t i=0;i<busyVecTheor_.size() && i<nbMachines.size();i++) {
          if (!procstat)
            sum+=machineWeight[i]*nbMachines[i]*busyVecTheor_[i];
          else
            sum+=machineWeight[i]*nbMachines[i]*busyCPUVecTheor_[i];
          sumMachines+=machineWeight[i]*nbMachines[i];
        }
        if (sumMachines>0)
          return sum/sumMachines;
        else return 0.;
      }
unsigned int evf::iDie::commonLsStat::getNReports ( ) [inline]

Definition at line 290 of file iDie.h.

References i, and nbMachines.

Referenced by evf::iDie::updateRollingHistos().

                                 {
        unsigned int sum=0;
        for (size_t i=0;i<nbMachines.size();i++) sum+=nbMachines[i];
        return sum;
      }
unsigned int evf::iDie::commonLsStat::getTotalRate ( ) [inline]

Definition at line 254 of file iDie.h.

References i, and rateVec_.

Referenced by evf::iDie::updateRollingHistos().

                                  {
        unsigned int totRate=0;
        for (size_t i=0;i<rateVec_.size();i++) totRate+=rateVec_[i];
        return totRate;
      } 
std::string evf::iDie::commonLsStat::printInfo ( ) [inline]

Definition at line 296 of file iDie.h.

References busyVec_, i, info, nbMachines, and rateVec_.

                            {
        std::ostringstream info;
        for (size_t i=0;i<rateVec_.size();i++) {
          info << i << "/r:" << rateVec_[i] <<"/b:"<<busyVec_[i]<<"/n:"<<nbMachines[i]<<"; ";
        }
        return info.str();
      }
void evf::iDie::commonLsStat::setBusyForClass ( unsigned int  classIdx,
unsigned int  rate,
float  busy,
float  busyTheor,
float  busyCPU,
float  busyCPUTheor,
unsigned int  nMachineReports 
) [inline]

Definition at line 245 of file iDie.h.

References busyCPUVec_, busyCPUVecTheor_, busyVec_, busyVecTheor_, nbMachines, RPCpg::rate(), and rateVec_.

Referenced by evf::iDie::updateRollingHistos().

                                                                                                                                                                {
        rateVec_[classIdx]=rate;
        busyVec_[classIdx]=busy;
        busyCPUVec_[classIdx]=busyCPU;
        busyVecTheor_[classIdx]=busyTheor;
        busyCPUVecTheor_[classIdx]=busyCPUTheor;
        nbMachines[classIdx]=nMachineReports;
      }

Member Data Documentation

Definition at line 230 of file iDie.h.

Referenced by commonLsStat(), getBusyTotalFrac(), and setBusyForClass().

Definition at line 232 of file iDie.h.

Referenced by commonLsStat(), getBusyTotalFracTheor(), and setBusyForClass().

Definition at line 229 of file iDie.h.

Referenced by commonLsStat(), getBusyTotalFrac(), printInfo(), and setBusyForClass().

Definition at line 231 of file iDie.h.

Referenced by commonLsStat(), getBusyTotalFracTheor(), and setBusyForClass().

Definition at line 227 of file iDie.h.

Referenced by commonLsStat().

std::vector<unsigned int> evf::iDie::commonLsStat::nbMachines
std::vector<unsigned int> evf::iDie::commonLsStat::rateVec_

Definition at line 228 of file iDie.h.

Referenced by commonLsStat(), getTotalRate(), printInfo(), and setBusyForClass().