10 #include <tbb/concurrent_vector.h>
16 #define MAXUPDATES 200
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;
258 ss << (unsigned int) (static_cast<std::vector<AtomicMonUInt*>*>(
tracked_))->at(
fastIndex_)->load(std::memory_order_relaxed);
260 ss << (unsigned int) *((static_cast<std::vector<AtomicMonUInt*>*>(
tracked_))->at(
fastIndex_));
271 return (static_cast<JsonMonitorable*>(
tracked_))->toString();
283 newJ->
add(static_cast<IntJ*>(itr->second.get())->
value());
305 root[
DATA].
append(itr->second.get()->toString());
317 std::stringstream ss;
323 std::stringstream ss;
324 unsigned int updates=0;
329 sum+=
static_cast<IntJ*
>(itr->second.get())->
value();
349 unsigned int updates=0;
355 auto &hvec = monObj->
value();
356 for (
unsigned int i=0;
i<hvec.size();
i++) {
357 unsigned int thisbin=(
unsigned int) hvec[
i];
364 std::stringstream ss;
370 ss <<
buf_[
i] <<
",";
372 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
virtual std::string & getName()
void mergeAndSerialize(Json::Value &jsonRoot, unsigned int lumi, bool initJsonValue)
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual void deserialize(Json::Value &root)
void trackVectorUIntAtomic(std::string const &name, std::vector< AtomicMonUInt * > *monvec, bool NAifZeroUpdates)
std::string asString() const
void snapStreamAtomic(unsigned int lumi, unsigned int streamID)
void makeStreamLumiMap(unsigned int size)
static const std::string DEFINITION
tuple size
Write out results.
string root
initialization