17 #include <sys/types.h>
20 using namespace jsoncollector;
23 defPath_(defPath),strictChecking_(strictChecking),useSource_(useSource),useDefinition_(useDefinition),nStreams_(1),deleteDef_(
true)
37 strictChecking_(strictChecking),useSource_(useSource),useDefinition_(useDefinition),nStreams_(1),dpd_(dpd)
90 assert (
uids_.insert(name).second);
104 assert (
uids_.insert(name).second);
111 std::vector<std::string>
const& jsonNames=
dpd_->
getNames();
116 std::map<unsigned int,bool> hasJson;
117 for (
unsigned int i=0;
i<jsonNames.size();
i++)
119 bool notFoundVar=
true;
148 std::map<unsigned int,bool> fhasJson;
149 for (
unsigned int i=0;
i<fjsonNames.size();
i++)
151 bool notFoundVar=
true;
165 bool notFoundVarSlow=
true;
171 notFoundVarSlow=
false;
178 if (notFoundVarSlow) {
221 std::stringstream
ss;
223 for (
unsigned int j=0;
j< monSize;
j++) {
225 if (
j<monSize-1) ss <<
",";
236 outputFile << csvString << std::endl;
246 return dataPoints_[it->second]->mergeAndRetrieveValue(forLumi);
253 <<
") in lumisection ";
270 for (
auto dp:
dataPoints_) dp->discardCollected(forLumi);
275 std::stringstream hpid;
276 int pid = (int) getpid();
278 gethostname(hostname,
sizeof hostname);
279 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 * dpdFast_
static std::vector< std::string > checklist log
void trackVectorUInt(std::string const &name, std::vector< unsigned int > *monvec, bool NAifZeroUpdates)
OperationType getOperationFor(unsigned int index)
bool outputFullJSON(std::string const &path, unsigned int lumi, bool log=true)
std::string getCSVString()
void trackDummy(std::string const &name, bool setNAifZeroUpdates)
virtual std::string & getName()
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::map< std::string, unsigned int > dpNameMap_
void trackMonitorable(JsonMonitorable *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)
tuple path
else: Piece not in the list, fine.
std::vector< DataPoint * > dataPoints_
void registerStreamMonitorableUIntVec(std::string const &name, std::vector< unsigned int > *inputs, bool NAifZeroUpdates, unsigned int *nBins=nullptr)
std::unordered_set< std::string > uids_
static void writeStringToFile(std::string const &filename, std::string &content)
virtual std::string write(const Value &root)
Serialize a Value in JSON format.
void commit(std::vector< unsigned int > *streamLumisPtr)
void trackVectorUIntAtomic(std::string const &name, std::vector< AtomicMonUInt * > *monvec, bool NAifZeroUpdates)
std::vector< DataPoint * > jsonDpIndexFast_
void outputCSV(std::string const &path, std::string const &csvString)
void snap(unsigned int ls)
unsigned int fregDpCount_
DataPointDefinition * dpd_
bool fastPathStrictChecking_
JsonMonitorable * getMergedIntJForLumi(std::string const &name, unsigned int forLumi)
unsigned int recentSnapsTimer_
std::vector< std::string > const & getNames()
void getHostAndPID(std::string &sHPid)
Writes a Value in JSON format in a human friendly way.
void discardCollected(unsigned int forLumi)
void snapGlobal(unsigned int ls)