10 #include <tbb/concurrent_vector.h>
16 #define MAXUPDATES 0xffffffff
19 using namespace jsoncollector;
21 namespace jsoncollector {
48 for (
unsigned int i = 0;
i <
data_.size();
i++)
57 for (
unsigned int i = 0;
i <
size;
i++) {
71 tracked_ = (
void const *)monitorable;
72 if (dynamic_cast<IntJ const *>(monitorable))
74 else if (dynamic_cast<DoubleJ const *>(monitorable))
76 else if (dynamic_cast<StringJ const *>(monitorable))
84 std::vector<unsigned int>
const *monvec,
85 bool NAifZeroUpdates) {
95 std::vector<AtomicMonUInt *>
const *monvec,
96 bool NAifZeroUpdates) {
107 for (
unsigned int i = 0;
i <
size;
i++) {
133 (
static_cast<std::vector<AtomicMonUInt *>
const *
>(
tracked_))->at(
i)->load(std::memory_order_relaxed);
136 monVal = *((
static_cast<std::vector<AtomicMonUInt *>
const *
>(
tracked_))->at(
i));
139 monVal = (
static_cast<std::vector<unsigned int>
const *
>(
tracked_))->at(
i);
160 *(
static_cast<IntJ *
>(itr->second.get())) = monVal;
193 static_cast<IntJ *
>(itr->second.get())->
update((static_cast<IntJ const *>(
tracked_))->value());
195 static_cast<DoubleJ *
>(itr->second.get())->
update((static_cast<DoubleJ const *>(
tracked_))->value());
197 static_cast<StringJ *
>(itr->second.get())->concatenate((static_cast<StringJ const *>(
tracked_))->value());
210 (
static_cast<std::vector<AtomicMonUInt *>
const *
>(
tracked_))->at(streamID)->load(std::memory_order_relaxed);
213 monVal = *((
static_cast<std::vector<AtomicMonUInt *>
const *
>(
tracked_))->at(streamID));
216 monVal = (
static_cast<std::vector<unsigned int>
const *
>(
tracked_))->at(streamID);
239 *(
static_cast<IntJ *
>(itr->second.get())) = monVal;
248 std::stringstream
ss;
254 ss << (unsigned int)*((static_cast<std::vector<AtomicMonUInt *>
const *>(
tracked_))->at(
fastIndex_));
263 ss << (unsigned int)*((static_cast<std::vector<AtomicMonUInt *>
const *>(
tracked_))->at(
unsigned(sid)));
265 ss << (static_cast<std::vector<unsigned int>
const *>(
tracked_))->at(
unsigned(sid));
269 return (static_cast<JsonMonitorable const *>(
tracked_))->toString();
280 newJ->
add(static_cast<IntJ *>(itr->second.get())->
value());
301 root[
DATA].
append(itr->second.get()->toString());
314 std::stringstream
ss;
320 std::stringstream
ss;
321 unsigned int updates = 0;
322 unsigned int sum = 0;
327 sum +=
static_cast<IntJ *
>(itr->second.get())->
value();
334 sum +=
static_cast<IntJ *
>(itr->second.get())->
value();
356 unsigned int updates = 0;
363 auto &hvec = monObj->
value();
364 for (
unsigned int j = 0;
j < hvec.size();
j++) {
365 unsigned int thisbin = (
unsigned int)hvec[
j];
377 auto &hvec = monObj->
value();
378 for (
unsigned int j = 0;
j < hvec.size();
j++) {
379 unsigned int thisbin = (
unsigned int)hvec[
j];
386 std::stringstream
ss;
393 ss <<
buf_[
i] <<
",";
395 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)
static const std::string SOURCE
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 ...
Value & append(const Value &value)
Append value to array at the end.
void update(std::string const &newStr)
unsigned int getUpdates()
std::map< unsigned int, JsonMonPtr > MonPtrMap
void trackMonitorable(JsonMonitorable const *monitorable, bool NAifZeroUpdates)
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)
void serialize(Json::Value &root) const override
std::vector< std::string > data_
JsonMonitorable * mergeAndRetrieveValue(unsigned int forLumi)
virtual std::string const & getName() const
std::string fastOutCSV(int sid=-1)
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)
std::string asString() const
void deserialize(Json::Value &root) override
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static const std::string DEFINITION
tuple size
Write out results.