10 #include <tbb/concurrent_vector.h>
16 #define MAXUPDATES 0xffffffff
19 using namespace jsoncollector;
21 namespace jsoncollector {
51 for (
unsigned int i=0;
i<
data_.size();
i++)
62 for (
unsigned int i = 0;
i <
size;
i++) {
109 for (
unsigned int i=0;
i<
size;
i++) {
136 if (
isAtomic_) monVal = (
static_cast<std::vector<AtomicMonUInt*>*
>(
tracked_))->at(
i)->load(std::memory_order_relaxed);
138 if (
isAtomic_) monVal = *((
static_cast<std::vector<AtomicMonUInt*>*
>(
tracked_))->at(
i));
140 else monVal = (
static_cast<std::vector<unsigned int>*
>(
tracked_))->at(
i);
165 *(
static_cast<IntJ*
>(itr->second.get()))=monVal;
198 static_cast<IntJ*
>(itr->second.get())->
update((static_cast<IntJ*>(
tracked_))->value());
202 static_cast<StringJ*
>(itr->second.get())->concatenate((static_cast<StringJ*>(
tracked_))->value());
214 if (
isAtomic_) monVal = (
static_cast<std::vector<AtomicMonUInt*>*
>(
tracked_))->at(streamID)->load(std::memory_order_relaxed);
216 if (
isAtomic_) monVal = *((
static_cast<std::vector<AtomicMonUInt*>*
>(
tracked_))->at(streamID));
218 else monVal = (
static_cast<std::vector<unsigned int>*
>(
tracked_))->at(streamID);
245 *(
static_cast<IntJ*
>(itr->second.get()))=monVal;
255 std::stringstream
ss;
261 ss << (unsigned int) *((static_cast<std::vector<AtomicMonUInt*>*>(
tracked_))->at(
fastIndex_));
272 ss << (unsigned int) *((static_cast<std::vector<AtomicMonUInt*>*>(
tracked_))->at(
unsigned(sid)));
274 ss << (static_cast<std::vector<unsigned int>*>(
tracked_))->at(
unsigned(sid));
278 return (static_cast<JsonMonitorable*>(
tracked_))->toString();
290 newJ->
add(static_cast<IntJ*>(itr->second.get())->
value());
312 root[
DATA].
append(itr->second.get()->toString());
324 std::stringstream
ss;
330 std::stringstream
ss;
331 unsigned int updates=0;
337 sum+=
static_cast<IntJ*
>(itr->second.get())->
value();
344 sum+=
static_cast<IntJ*
>(itr->second.get())->
value();
364 unsigned int updates=0;
371 auto &hvec = monObj->
value();
372 for (
unsigned int j=0;
j<hvec.size();
j++) {
373 unsigned int thisbin=(
unsigned int) hvec[
j];
385 auto &hvec = monObj->
value();
386 for (
unsigned int j=0;
j<hvec.size();
j++) {
387 unsigned int thisbin=(
unsigned int) hvec[
j];
394 std::stringstream
ss;
400 ss <<
buf_[
i] <<
",";
402 ss <<
buf_[*nBinsPtr_-1];
Value get(UInt index, const Value &defaultValue) const
void snap(unsigned int lumi)
std::vector< unsigned int > * streamLumisPtr_
void discardCollected(unsigned int forLumi)
void trackVectorUInt(std::string const &name, std::vector< unsigned int > *monvec, bool NAifZeroUpdates)
static const std::string SOURCE
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual std::string & getName()
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
virtual void serialize(Json::Value &root) const
Value & append(const Value &value)
Append value to array at the end.
void trackMonitorable(JsonMonitorable *monitorable, bool NAifZeroUpdates)
void update(std::string const &newStr)
std::map< unsigned int, JsonMonPtr > MonPtrMap
unsigned int getUpdates()
std::vector< T > & value()
static std::string const input
static const std::string DATA
UInt size() const
Number of values in array or object.
std::vector< MonPtrMap > streamDataMaps_
void snapGlobal(unsigned int lumi)
std::vector< std::string > data_
JsonMonitorable * mergeAndRetrieveValue(unsigned int forLumi)
std::string fastOutCSV(int sid=-1)
virtual void deserialize(Json::Value &root)
void trackVectorUIntAtomic(std::string const &name, std::vector< AtomicMonUInt * > *monvec, bool NAifZeroUpdates)
std::string asString() const
void mergeAndSerialize(Json::Value &jsonRoot, unsigned int lumi, bool initJsonValue, int sid)
void snapStreamAtomic(unsigned int lumi, unsigned int streamID)
void makeStreamLumiMap(unsigned int size)
static const std::string DEFINITION
tuple size
Write out results.