17 #include <sys/types.h>
19 #include <boost/filesystem/fstream.hpp>
21 using namespace jsoncollector;
24 defPath_(defPath),strictChecking_(strictChecking),useSource_(useSource),useDefinition_(useDefinition),nStreams_(1),deleteDef_(
true)
38 strictChecking_(strictChecking),useSource_(useSource),useDefinition_(useDefinition),nStreams_(1),dpd_(dpd)
112 std::vector<std::string>
const& jsonNames=
dpd_->
getNames();
117 std::map<unsigned int,bool> hasJson;
118 for (
unsigned int i=0;
i<jsonNames.size();
i++)
120 bool notFoundVar=
true;
149 std::map<unsigned int,bool> fhasJson;
150 for (
unsigned int i=0;
i<fjsonNames.size();
i++)
152 bool notFoundVar=
true;
166 bool notFoundVarSlow=
true;
172 notFoundVarSlow=
false;
179 if (notFoundVarSlow) {
222 std::stringstream
ss;
224 for (
unsigned int j=0;
j< monSize;
j++) {
226 if (
j<monSize-1) ss <<
",";
237 outputFile << csvString << std::endl;
247 return dataPoints_[it->second]->mergeAndRetrieveValue(forLumi);
253 <<
") in lumisection ";
262 std::stringstream tidext;
263 tidext <<
"_tid" <<
i;
276 <<
") in lumisection ";
297 std::stringstream hpid;
298 int pid = (int) getpid();
300 gethostname(hostname,
sizeof hostname);
301 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_
void trackVectorUInt(std::string const &name, std::vector< unsigned int > *monvec, bool NAifZeroUpdates)
OperationType getOperationFor(unsigned int index)
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)
bool outputFullJSONs(std::string const &pathstem, std::string const &ext, unsigned int lumi)
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::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::string getCSVString(int sid=-1)
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)
bool outputFullJSON(std::string const &path, unsigned int lumi)
void snapGlobal(unsigned int ls)