17 #include <sys/types.h>
20 using namespace jsoncollector;
23 std::string const& defPath,
std::string const defGroup,
bool strictChecking,
bool useSource,
bool useDefinition)
25 strictChecking_(strictChecking),
26 useSource_(useSource),
27 useDefinition_(useDefinition),
41 : strictChecking_(strictChecking), useSource_(useSource), useDefinition_(useDefinition), nStreams_(1), dpd_(dpd) {
69 unsigned int* nBins) {
89 std::vector<unsigned int>*
inputs,
91 unsigned int* nBins) {
102 std::vector<AtomicMonUInt*>*
inputs,
103 bool NAifZeroUpdates,
104 unsigned int* nBins) {
117 std::vector<std::string>
const& jsonNames =
dpd_->
getNames();
122 std::map<unsigned int, bool> hasJson;
123 for (
unsigned int i = 0;
i < jsonNames.size();
i++) {
124 bool notFoundVar =
true;
152 std::map<unsigned int, bool> fhasJson;
153 for (
unsigned int i = 0;
i < fjsonNames.size();
i++) {
154 bool notFoundVar =
true;
166 bool notFoundVarSlow =
true;
171 notFoundVarSlow =
false;
178 if (notFoundVarSlow) {
217 std::stringstream
ss;
219 for (
unsigned int j = 0;
j < monSize;
j++) {
232 outputFile << csvString << std::endl;
240 return dataPoints_[it->second]->mergeAndRetrieveValue(forLumi);
245 <<
") in lumisection ";
257 std::stringstream tidext;
258 tidext <<
"_tid" <<
i;
270 <<
") in lumisection ";
288 dp->discardCollected(forLumi);
292 std::stringstream hpid;
293 int pid = (int)getpid();
295 gethostname(hostname,
sizeof hostname);
296 hpid << hostname <<
"_" << pid;
void registerFastGlobalMonitorable(JsonMonitorable *newMonitorable)
void addFastPathDefinition(std::string const &defPathFast, std::string const defGroupFast, bool strict)
void setNBins(unsigned int *nBins)
DataPointDefinition const * dpd_
void trackDummy(std::string const &name, bool setNAifZeroUpdates)
void snapStreamAtomic(unsigned int ls, unsigned int streamID)
void registerStreamMonitorableUIntVecAtomic(std::string const &name, std::vector< AtomicMonUInt * > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::vector< DataPoint * > dataPointsFastOnly_
std::vector< std::string > const & getNames() const
void trackMonitorable(JsonMonitorable const *monitorable, bool NAifZeroUpdates)
FastMonitor(std::string const &defPath, std::string const defGroup, bool strictChecking, bool useSource=true, bool useDefinition=true)
void registerGlobalMonitorable(JsonMonitorable *newMonitorable, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::vector< unsigned int > jsonDpIndex_
U second(std::pair< T, U > const &p)
unsigned int recentSnaps_
static bool getDataPointDefinitionFor(std::string &defFilePath, DataPointDefinition *dpd, const std::string *defaultGroup=nullptr)
std::vector< DataPoint * > dataPoints_
void registerStreamMonitorableUIntVec(std::string const &name, std::vector< unsigned int > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::map< std::string, unsigned int > dpNameMap_
virtual std::string const & getName() const
std::unordered_set< std::string > uids_
static void writeStringToFile(std::string const &filename, std::string &content)
void commit(std::vector< unsigned int > *streamLumisPtr)
void trackVectorUIntAtomic(std::string const &name, std::vector< AtomicMonUInt * > const *monvec, bool NAifZeroUpdates)
void trackVectorUInt(std::string const &name, std::vector< unsigned int > const *monvec, bool NAifZeroUpdates)
TString getName(TString structure, int layer, TString geometry)
std::string getCSVString(int sid=-1)
OperationType getOperationFor(unsigned int index) const
bool outputFullJSON(std::string const &path, unsigned int lumi, bool output=true)
std::vector< DataPoint * > jsonDpIndexFast_
DataPointDefinition const * dpdFast_
void outputCSV(std::string const &path, std::string const &csvString)
std::string write(const Value &root) override
Serialize a Value in JSON format.
void snap(unsigned int ls)
unsigned int fregDpCount_
bool fastPathStrictChecking_
JsonMonitorable * getMergedIntJForLumi(std::string const &name, unsigned int forLumi)
unsigned int recentSnapsTimer_
void getHostAndPID(std::string &sHPid)
Writes a Value in JSON format in a human friendly way.
void discardCollected(unsigned int forLumi)
bool outputFullJSONs(std::string const &pathstem, std::string const &ext, unsigned int lumi, bool output=true)
void snapGlobal(unsigned int ls)