| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Thibaut Oprinsen | ||
| 3 | Mail : thibaut.oprinsen@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "swarm_stat_utils.h" | ||
| 8 | |||
| 9 | ///Create a DaemonStat | ||
| 10 | /** @return corresponding DaemonStat | ||
| 11 | */ | ||
| 12 | ✗ | DaemonStat createStatistics(){ | |
| 13 | ✗ | DaemonStat stat; | |
| 14 | ✗ | stat.setName("StatManager"); | |
| 15 | ✗ | stat.getMapStatComputing().insert(std::make_pair("Stat1", createVecStat(1lu))); | |
| 16 | ✗ | stat.getMapStatComputing().insert(std::make_pair("Stat2", createVecStat(2lu))); | |
| 17 | ✗ | stat.getMapStatCommunication()["DaemonA"].insert(std::make_pair("DataType1", createVecStat(3lu))); | |
| 18 | ✗ | stat.getMapStatCommunication()["DaemonA"].insert(std::make_pair("DataType2", createVecStat(4lu))); | |
| 19 | ✗ | return stat; | |
| 20 | ✗ | } | |
| 21 | |||
| 22 | ///Create a vector of statistics | ||
| 23 | /** @param nbValue : number of values to generate | ||
| 24 | * @return corresponding vector of statistics | ||
| 25 | */ | ||
| 26 | ✗ | VecStat createVecStat(size_t nbValue){ | |
| 27 | ✗ | VecStat stat; | |
| 28 | ✗ | stat.getNbEvent().push_back(nbValue); | |
| 29 | ✗ | stat.getStartTimestamp().push_back(nbValue); | |
| 30 | ✗ | stat.getEndTimestamp().push_back(nbValue); | |
| 31 | ✗ | stat.getMin().push_back(nbValue); | |
| 32 | ✗ | stat.getMax().push_back(nbValue); | |
| 33 | ✗ | stat.getAverage().push_back(nbValue); | |
| 34 | ✗ | stat.getRate().push_back(nbValue); | |
| 35 | ✗ | std::vector<float> vecQuantile; | |
| 36 | ✗ | vecQuantile.push_back(nbValue); | |
| 37 | ✗ | vecQuantile.push_back(nbValue); | |
| 38 | ✗ | vecQuantile.push_back(nbValue); | |
| 39 | ✗ | stat.getVecRateQuantile().push_back(vecQuantile); | |
| 40 | ✗ | stat.getRateEventBelowLowerBound().push_back(nbValue); | |
| 41 | ✗ | stat.getRateEventAboveUpperBound().push_back(nbValue); | |
| 42 | ✗ | return stat; | |
| 43 | ✗ | } | |
| 44 |