CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes | Protected Attributes
jsoncollector::DataPoint Class Reference

#include <DataPoint.h>

Inheritance diagram for jsoncollector::DataPoint:
jsoncollector::JsonSerializable

Public Member Functions

 DataPoint ()
 
 DataPoint (std::string const &source, std::string const &definition, bool fast=false)
 
void deserialize (Json::Value &root) override
 
void discardCollected (unsigned int forLumi)
 
std::string fastOutCSV (int sid=-1)
 
std::vector< std::string > & getData ()
 
std::string & getDefinition ()
 
std::string const & getName () const
 
void makeStreamLumiMap (unsigned int size)
 
JsonMonitorablemergeAndRetrieveValue (unsigned int forLumi)
 
void mergeAndSerialize (Json::Value &jsonRoot, unsigned int lumi, bool initJsonValue, int sid)
 
void serialize (Json::Value &root) const override
 
void serialize (Json::Value &root, bool rootInit, std::string const &input) const
 
void setNBins (unsigned int *nBins)
 
void setOperation (OperationType op)
 
void setStreamLumiPtr (std::vector< unsigned int > *streamLumiPtr)
 
void snap (unsigned int lumi)
 
void snapGlobal (unsigned int lumi)
 
void snapStreamAtomic (unsigned int lumi, unsigned int streamID)
 
void trackDummy (std::string const &name, bool setNAifZeroUpdates)
 
void trackMonitorable (JsonMonitorable const *monitorable, bool NAifZeroUpdates)
 
void trackVectorUInt (std::string const &name, std::vector< unsigned int > const *monvec, bool NAifZeroUpdates)
 
void trackVectorUIntAtomic (std::string const &name, std::vector< AtomicMonUInt * > const *monvec, bool NAifZeroUpdates)
 
void updateDefinition (std::string const &definition)
 
 ~DataPoint () override
 
- Public Member Functions inherited from jsoncollector::JsonSerializable
virtual ~JsonSerializable ()
 

Static Public Attributes

static const std::string DATA = "data"
 
static const std::string DEFINITION = "definition"
 
static const std::string SOURCE = "source"
 

Protected Attributes

uint32_t * buf_ = nullptr
 
unsigned int bufLen_ = 0
 
int cacheI_
 
std::vector< std::string > data_
 
std::string definition_
 
unsigned int fastIndex_ = 0
 
MonPtrMap globalDataMap_
 
bool isAtomic_ = false
 
bool isCached_ = false
 
bool isDummy_ = false
 
bool isFastOnly_
 
bool isStream_ = false
 
MonType monType_
 
bool NAifZeroUpdates_ = false
 
std::string name_
 
unsigned int * nBinsPtr_ = nullptr
 
OperationType opType_
 
std::string source_
 
std::vector< MonPtrMapstreamDataMaps_
 
std::vector< unsigned int > * streamLumisPtr_ = nullptr
 
void const * tracked_ = nullptr
 

Detailed Description

Definition at line 36 of file DataPoint.h.

Constructor & Destructor Documentation

jsoncollector::DataPoint::DataPoint ( )
inline

Definition at line 38 of file DataPoint.h.

38 {}
jsoncollector::DataPoint::DataPoint ( std::string const &  source,
std::string const &  definition,
bool  fast = false 
)
inline

Definition at line 40 of file DataPoint.h.

41  : source_(source), definition_(definition), isFastOnly_(fast) {}
std::string definition_
Definition: DataPoint.h:123
static std::string const source
Definition: EdmProvDump.cc:46
DataPoint::~DataPoint ( )
override

Definition at line 30 of file DataPoint.cc.

References buf_.

30  {
31  if (buf_)
32  delete[] buf_;
33 }

Member Function Documentation

void DataPoint::deserialize ( Json::Value root)
overridevirtual

JSON deserialization procedure for this class

Implements jsoncollector::JsonSerializable.

Definition at line 52 of file DataPoint.cc.

References Json::Value::asString(), DATA, data_, DEFINITION, definition_, Json::Value::get(), mps_fire::i, Json::Value::isArray(), Json::Value::size(), findQualityFiles::size, SOURCE, and source_.

Referenced by evf::EvFDaqDirector::getNFilesFromEoLS(), evf::EvFDaqDirector::grabNextJsonFile(), and evf::EvFDaqDirector::grabNextJsonFileAndUnlock().

52  {
53  source_ = root.get(SOURCE, "").asString();
54  definition_ = root.get(DEFINITION, "").asString();
55  if (root.get(DATA, "").isArray()) {
56  unsigned int size = root.get(DATA, "").size();
57  for (unsigned int i = 0; i < size; i++) {
58  data_.push_back(root.get(DATA, "")[i].asString());
59  }
60  }
61 }
Value get(UInt index, const Value &defaultValue) const
static const std::string SOURCE
Definition: DataPoint.h:116
std::string definition_
Definition: DataPoint.h:123
static const std::string DATA
Definition: DataPoint.h:118
UInt size() const
Number of values in array or object.
bool isArray() const
std::vector< std::string > data_
Definition: DataPoint.h:124
std::string asString() const
static const std::string DEFINITION
Definition: DataPoint.h:117
tuple size
Write out results.
void DataPoint::discardCollected ( unsigned int  forLumi)

Definition at line 406 of file DataPoint.cc.

References dataset::end, globalDataMap_, mps_fire::i, and streamDataMaps_.

406  {
407  for (unsigned int i = 0; i < streamDataMaps_.size(); i++) {
408  auto itr = streamDataMaps_[i].find(lumi);
409  if (itr != streamDataMaps_[i].end())
410  streamDataMaps_[i].erase(lumi);
411  }
412 
413  auto itr = globalDataMap_.find(lumi);
414  if (itr != globalDataMap_.end())
415  globalDataMap_.erase(lumi);
416 }
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
list lumi
Definition: dqmdumpme.py:53
string end
Definition: dataset.py:937
std::string DataPoint::fastOutCSV ( int  sid = -1)

Definition at line 245 of file DataPoint.cc.

References fastIndex_, isAtomic_, isStream_, findQualityFiles::size, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and tracked_.

245  {
246  if (tracked_) {
247  if (isStream_) {
248  std::stringstream ss;
249  if (sid < 0) {
250  if (isAtomic_) {
251  // if ATOMIC_LEVEL>0
252  // ss << (unsigned int) (static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->at(fastIndex_)->load(std::memory_order_relaxed);
253 
254  ss << (unsigned int)*((static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(fastIndex_));
255  fastIndex_ = (fastIndex_ + 1) % (static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->size();
256  } else {
257  ss << (static_cast<std::vector<unsigned int> const *>(tracked_))->at(fastIndex_);
258  fastIndex_ = (fastIndex_ + 1) % (static_cast<std::vector<unsigned int> const *>(tracked_))->size();
259  }
260 
261  } else {
262  if (isAtomic_)
263  ss << (unsigned int)*((static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(unsigned(sid)));
264  else
265  ss << (static_cast<std::vector<unsigned int> const *>(tracked_))->at(unsigned(sid));
266  }
267  return ss.str();
268  }
269  return (static_cast<JsonMonitorable const *>(tracked_))->toString();
270  }
271  return std::string("");
272 }
unsigned int fastIndex_
Definition: DataPoint.h:151
void const * tracked_
Definition: DataPoint.h:128
tuple size
Write out results.
std::vector<std::string>& jsoncollector::DataPoint::getData ( void  )
inline
std::string& jsoncollector::DataPoint::getDefinition ( )
inline

Definition at line 57 of file DataPoint.h.

References definition_.

Referenced by evf::EvFDaqDirector::getNFilesFromEoLS().

57 { return definition_; }
std::string definition_
Definition: DataPoint.h:123
std::string const& jsoncollector::DataPoint::getName ( void  ) const
inline

Definition at line 111 of file DataPoint.h.

References name_.

Referenced by plotting.Plot::draw().

111 { return name_; }
void DataPoint::makeStreamLumiMap ( unsigned int  size)

Definition at line 106 of file DataPoint.cc.

References mps_fire::i, findQualityFiles::size, and streamDataMaps_.

Referenced by trackVectorUInt(), and trackVectorUIntAtomic().

106  {
107  for (unsigned int i = 0; i < size; i++) {
108  streamDataMaps_.push_back(MonPtrMap());
109  }
110 }
std::map< unsigned int, JsonMonPtr > MonPtrMap
Definition: DataPoint.h:34
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
tuple size
Write out results.
JsonMonitorable * DataPoint::mergeAndRetrieveValue ( unsigned int  forLumi)

Definition at line 274 of file DataPoint.cc.

References jsoncollector::IntJ::add(), cms::cuda::assert(), cacheI_, dataset::end, mps_fire::i, isCached_, isStream_, monType_, streamDataMaps_, jsoncollector::TYPEUINT, relativeConstraints::value, and jsoncollector::IntJ::value().

274  {
275  assert(monType_ == TYPEUINT && isStream_); //for now only support UINT and SUM for stream variables
276  IntJ *newJ = new IntJ;
277  for (unsigned int i = 0; i < streamDataMaps_.size(); i++) {
278  auto itr = streamDataMaps_[i].find(lumi);
279  if (itr != streamDataMaps_[i].end()) {
280  newJ->add(static_cast<IntJ *>(itr->second.get())->value());
281  }
282  }
283  cacheI_ = newJ->value();
284  isCached_ = true;
285  return newJ; //assume the caller takes care of deleting the object
286 }
assert(be >=bs)
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
void add(long sth)
list lumi
Definition: dqmdumpme.py:53
string end
Definition: dataset.py:937
void DataPoint::mergeAndSerialize ( Json::Value jsonRoot,
unsigned int  lumi,
bool  initJsonValue,
int  sid 
)

Definition at line 288 of file DataPoint.cc.

References Json::Value::append(), cms::cuda::assert(), buf_, bufLen_, cacheI_, DATA, DEFINITION, definition_, dataset::end, jsoncollector::JsonMonitorable::getUpdates(), globalDataMap_, mps_fire::i, isCached_, isDummy_, isStream_, dqmiolumiharvest::j, monType_, NAifZeroUpdates_, nBinsPtr_, jsoncollector::OPHISTO, opType_, SOURCE, source_, contentValuesCheck::ss, streamDataMaps_, jsoncollector::TYPESTRING, jsoncollector::TYPEUINT, relativeConstraints::value, and jsoncollector::HistoJ< T >::value().

288  {
289  if (initJsonValue) {
290  root[SOURCE] = source_;
291  root[DEFINITION] = definition_;
292  }
293 
294  if (isDummy_) {
295  root[DATA].append("N/A");
296  return;
297  }
298  if (!isStream_) {
299  auto itr = globalDataMap_.find(lumi);
300  if (itr != globalDataMap_.end()) {
301  root[DATA].append(itr->second.get()->toString());
302  } else {
303  if (NAifZeroUpdates_)
304  root[DATA].append("N/A");
305  else if (monType_ == TYPESTRING)
306  root[DATA].append("");
307  else
308  root[DATA].append("0");
309  }
310  return;
311  } else {
313  if (isCached_) {
314  std::stringstream ss;
315  ss << cacheI_;
316  root[DATA].append(ss.str());
317  return;
318  }
319  if (opType_ != OPHISTO) { //sum is default
320  std::stringstream ss;
321  unsigned int updates = 0;
322  unsigned int sum = 0;
323  if (sid < 1)
324  for (unsigned int i = 0; i < streamDataMaps_.size(); i++) {
325  auto itr = streamDataMaps_[i].find(lumi);
326  if (itr != streamDataMaps_[i].end()) {
327  sum += static_cast<IntJ *>(itr->second.get())->value();
328  updates++;
329  }
330  }
331  else {
332  auto itr = streamDataMaps_[unsigned(sid)].find(lumi);
333  if (itr != streamDataMaps_[unsigned(sid)].end()) {
334  sum += static_cast<IntJ *>(itr->second.get())->value();
335  updates++;
336  }
337  }
338  if (!updates && NAifZeroUpdates_)
339  ss << "N/A";
340  ss << sum;
341  root[DATA].append(ss.str());
342  return;
343  }
344  if (opType_ == OPHISTO) {
345  if (nBinsPtr_ == nullptr) {
346  root[DATA].append("N/A");
347  return;
348  }
349  if (*nBinsPtr_ > bufLen_) {
350  if (buf_)
351  delete[] buf_;
352  bufLen_ = *nBinsPtr_;
353  buf_ = new uint32_t[bufLen_];
354  }
355  memset(buf_, 0, bufLen_ * sizeof(uint32_t));
356  unsigned int updates = 0;
357  if (sid < 1)
358  for (unsigned int i = 0; i < streamDataMaps_.size(); i++) {
359  auto itr = streamDataMaps_[i].find(lumi);
360  if (itr != streamDataMaps_[i].end()) {
361  HistoJ<unsigned int> *monObj = static_cast<HistoJ<unsigned int> *>(itr->second.get());
362  updates += monObj->getUpdates();
363  auto &hvec = monObj->value();
364  for (unsigned int j = 0; j < hvec.size(); j++) {
365  unsigned int thisbin = (unsigned int)hvec[j];
366  if (thisbin < *nBinsPtr_) {
367  buf_[thisbin]++;
368  }
369  }
370  }
371  }
372  else {
373  auto itr = streamDataMaps_[unsigned(sid)].find(lumi);
374  if (itr != streamDataMaps_[unsigned(sid)].end()) {
375  HistoJ<unsigned int> *monObj = static_cast<HistoJ<unsigned int> *>(itr->second.get());
376  updates += monObj->getUpdates();
377  auto &hvec = monObj->value();
378  for (unsigned int j = 0; j < hvec.size(); j++) {
379  unsigned int thisbin = (unsigned int)hvec[j];
380  if (thisbin < *nBinsPtr_) {
381  buf_[thisbin]++;
382  }
383  }
384  }
385  }
386  std::stringstream ss;
387  if (!*nBinsPtr_ || (!updates && NAifZeroUpdates_))
388  ss << "N/A";
389  else {
390  ss << "[";
391  if (*nBinsPtr_) {
392  for (unsigned int i = 0; i < *nBinsPtr_ - 1; i++) {
393  ss << buf_[i] << ",";
394  }
395  ss << buf_[*nBinsPtr_ - 1];
396  }
397  ss << "]";
398  }
399  root[DATA].append(ss.str());
400  return;
401  }
402  }
403 }
OperationType opType_
Definition: DataPoint.h:140
static const std::string SOURCE
Definition: DataPoint.h:116
assert(be >=bs)
std::vector< T > & value()
std::string definition_
Definition: DataPoint.h:123
static const std::string DATA
Definition: DataPoint.h:118
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
unsigned int bufLen_
Definition: DataPoint.h:145
list lumi
Definition: dqmdumpme.py:53
string end
Definition: dataset.py:937
static const std::string DEFINITION
Definition: DataPoint.h:117
unsigned int * nBinsPtr_
Definition: DataPoint.h:147
void DataPoint::serialize ( Json::Value root) const
overridevirtual

JSON serialization procedure for this class

Implements jsoncollector::JsonSerializable.

Definition at line 41 of file DataPoint.cc.

References bitset_utilities::append(), DATA, data_, DEFINITION, definition_, mps_fire::i, SOURCE, and source_.

41  {
42  if (!source_.empty()) {
43  root[SOURCE] = source_;
44  }
45  if (!definition_.empty()) {
46  root[DEFINITION] = definition_;
47  }
48  for (unsigned int i = 0; i < data_.size(); i++)
49  root[DATA].append(data_[i]);
50 }
static const std::string SOURCE
Definition: DataPoint.h:116
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 ...
std::string definition_
Definition: DataPoint.h:123
static const std::string DATA
Definition: DataPoint.h:118
std::vector< std::string > data_
Definition: DataPoint.h:124
static const std::string DEFINITION
Definition: DataPoint.h:117
void DataPoint::serialize ( Json::Value root,
bool  rootInit,
std::string const &  input 
) const

Functions specific to new monitoring implementation

Definition at line 112 of file DataPoint.cc.

References Json::Value::append(), DATA, DEFINITION, definition_, SOURCE, and source_.

112  {
113  if (rootInit) {
114  if (!source_.empty())
115  root[SOURCE] = source_;
116  if (!definition_.empty())
117  root[DEFINITION] = definition_;
118  }
119  root[DATA].append(input);
120 }
static const std::string SOURCE
Definition: DataPoint.h:116
Value & append(const Value &value)
Append value to array at the end.
std::string definition_
Definition: DataPoint.h:123
static std::string const input
Definition: EdmProvDump.cc:47
static const std::string DATA
Definition: DataPoint.h:118
static const std::string DEFINITION
Definition: DataPoint.h:117
void jsoncollector::DataPoint::setNBins ( unsigned int *  nBins)
inline
void jsoncollector::DataPoint::setOperation ( OperationType  op)
inline

Definition at line 91 of file DataPoint.h.

References opType_.

91 { opType_ = op; }
OperationType opType_
Definition: DataPoint.h:140
void jsoncollector::DataPoint::setStreamLumiPtr ( std::vector< unsigned int > *  streamLumiPtr)
inline

Definition at line 94 of file DataPoint.h.

References streamLumisPtr_.

94 { streamLumisPtr_ = streamLumiPtr; }
std::vector< unsigned int > * streamLumisPtr_
Definition: DataPoint.h:131
void DataPoint::snap ( unsigned int  lumi)

Definition at line 122 of file DataPoint.cc.

References cms::cuda::assert(), dataset::end, mps_fire::i, isAtomic_, isCached_, isStream_, MAXUPDATES, monType_, nBinsPtr_, cms::cuda::nh, jsoncollector::OPHISTO, opType_, snapGlobal(), streamDataMaps_, streamLumisPtr_, tracked_, jsoncollector::TYPEINT, jsoncollector::TYPEUINT, jsoncollector::IntJ::update(), and jsoncollector::HistoJ< T >::update().

122  {
123  isCached_ = false;
124  if (isStream_) {
125  if (monType_ == TYPEUINT) {
126  for (unsigned int i = 0; i < streamDataMaps_.size(); i++) {
127  unsigned int streamLumi_ = streamLumisPtr_->at(i); //get currently processed stream lumi
128  unsigned int monVal;
129 
130 #if ATOMIC_LEVEL > 0
131  if (isAtomic_)
132  monVal =
133  (static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(i)->load(std::memory_order_relaxed);
134 #else
135  if (isAtomic_)
136  monVal = *((static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(i));
137 #endif
138  else
139  monVal = (static_cast<std::vector<unsigned int> const *>(tracked_))->at(i);
140 
141  auto itr = streamDataMaps_[i].find(streamLumi_);
142  if (itr == streamDataMaps_[i].end()) {
143  if (opType_ == OPHISTO) {
144  if (*nBinsPtr_) {
146  nh->update(monVal);
147  streamDataMaps_[i][streamLumi_] = nh;
148  }
149  } else { //default to SUM
150  IntJ *nj = new IntJ;
151  nj->update(monVal);
152  streamDataMaps_[i][streamLumi_] = nj;
153  }
154  } else {
155  if (opType_ == OPHISTO) {
156  if (*nBinsPtr_) {
157  (static_cast<HistoJ<unsigned int> *>(itr->second.get()))->update(monVal);
158  }
159  } else {
160  *(static_cast<IntJ *>(itr->second.get())) = monVal;
161  }
162  }
163  }
164  } else
165  assert(monType_ != TYPEINT); //not yet implemented, application error
166  } else
167  snapGlobal(lumi);
168 }
OperationType opType_
Definition: DataPoint.h:140
std::vector< unsigned int > * streamLumisPtr_
Definition: DataPoint.h:131
assert(be >=bs)
#define MAXUPDATES
Definition: DataPoint.cc:16
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
void snapGlobal(unsigned int lumi)
Definition: DataPoint.cc:170
void const * tracked_
Definition: DataPoint.h:128
uint32_t nh
list lumi
Definition: dqmdumpme.py:53
void update(long sth)
string end
Definition: dataset.py:937
unsigned int * nBinsPtr_
Definition: DataPoint.h:147
void DataPoint::snapGlobal ( unsigned int  lumi)

Definition at line 170 of file DataPoint.cc.

References globalDataMap_, isCached_, isStream_, dqmdumpme::lumi, monType_, tracked_, jsoncollector::TYPEDOUBLE, jsoncollector::TYPEINT, jsoncollector::TYPESTRING, update, jsoncollector::IntJ::update(), jsoncollector::DoubleJ::update(), jsoncollector::StringJ::update(), and relativeConstraints::value.

Referenced by snap().

170  {
171  isCached_ = false;
172  if (isStream_)
173  return;
174  auto itr = globalDataMap_.find(lumi);
175  if (itr == globalDataMap_.end()) {
176  if (monType_ == TYPEINT) {
177  IntJ *ij = new IntJ;
178  ij->update((static_cast<IntJ const *>(tracked_))->value());
179  globalDataMap_[lumi] = ij;
180  }
181  if (monType_ == TYPEDOUBLE) {
182  DoubleJ *dj = new DoubleJ;
183  dj->update((static_cast<DoubleJ const *>(tracked_))->value());
184  globalDataMap_[lumi] = dj;
185  }
186  if (monType_ == TYPESTRING) {
187  StringJ *sj = new StringJ;
188  sj->update((static_cast<StringJ const *>(tracked_))->value());
189  globalDataMap_[lumi] = sj;
190  }
191  } else {
192  if (monType_ == TYPEINT)
193  static_cast<IntJ *>(itr->second.get())->update((static_cast<IntJ const *>(tracked_))->value());
194  else if (monType_ == TYPEDOUBLE)
195  static_cast<DoubleJ *>(itr->second.get())->update((static_cast<DoubleJ const *>(tracked_))->value());
196  else if (monType_ == TYPESTRING)
197  static_cast<StringJ *>(itr->second.get())->concatenate((static_cast<StringJ const *>(tracked_))->value());
198  }
199 }
void update(std::string const &newStr)
void const * tracked_
Definition: DataPoint.h:128
list lumi
Definition: dqmdumpme.py:53
void update(long sth)
#define update(a, b)
void update(double sth)
void DataPoint::snapStreamAtomic ( unsigned int  lumi,
unsigned int  streamID 
)

Definition at line 201 of file DataPoint.cc.

References cms::cuda::assert(), dataset::end, h, isAtomic_, isCached_, isStream_, dqmdumpme::lumi, MAXUPDATES, monType_, nBinsPtr_, jsoncollector::OPHISTO, opType_, streamDataMaps_, tracked_, jsoncollector::TYPEINT, jsoncollector::TYPEUINT, update, jsoncollector::IntJ::update(), and jsoncollector::HistoJ< T >::update().

201  {
202  if (!isStream_ || !isAtomic_)
203  return;
204  isCached_ = false;
205  if (monType_ == TYPEUINT) {
206  unsigned int monVal;
207 #if ATOMIC_LEVEL > 0
208  if (isAtomic_)
209  monVal =
210  (static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(streamID)->load(std::memory_order_relaxed);
211 #else
212  if (isAtomic_)
213  monVal = *((static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(streamID));
214 #endif
215  else
216  monVal = (static_cast<std::vector<unsigned int> const *>(tracked_))->at(streamID);
217 
218  auto itr = streamDataMaps_[streamID].find(lumi);
219  if (itr == streamDataMaps_[streamID].end()) //insert
220  {
221  if (opType_ == OPHISTO) {
222  if (*nBinsPtr_) {
224  h->update(monVal);
225  streamDataMaps_[streamID][lumi] = h;
226  }
227  } else { //default to SUM
228 
229  IntJ *h = new IntJ;
230  h->update(monVal);
231  streamDataMaps_[streamID][lumi] = h;
232  }
233  } else {
234  if (opType_ == OPHISTO) {
235  if (*nBinsPtr_) {
236  static_cast<HistoJ<unsigned int> *>(itr->second.get())->update(monVal);
237  }
238  } else
239  *(static_cast<IntJ *>(itr->second.get())) = monVal;
240  }
241  } else
242  assert(monType_ != TYPEINT); //not yet implemented
243 }
OperationType opType_
Definition: DataPoint.h:140
assert(be >=bs)
#define MAXUPDATES
Definition: DataPoint.cc:16
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
void const * tracked_
Definition: DataPoint.h:128
list lumi
Definition: dqmdumpme.py:53
void update(long sth)
#define update(a, b)
string end
Definition: dataset.py:937
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
unsigned int * nBinsPtr_
Definition: DataPoint.h:147
void jsoncollector::DataPoint::trackDummy ( std::string const &  name,
bool  setNAifZeroUpdates 
)
inline
void DataPoint::trackMonitorable ( JsonMonitorable const *  monitorable,
bool  NAifZeroUpdates 
)

Definition at line 69 of file DataPoint.cc.

References cms::cuda::assert(), jsoncollector::JsonMonitorable::getName(), monType_, NAifZeroUpdates_, name_, tracked_, jsoncollector::TYPEDOUBLE, jsoncollector::TYPEINT, and jsoncollector::TYPESTRING.

Referenced by jsoncollector::FastMonitor::registerFastGlobalMonitorable(), and jsoncollector::FastMonitor::registerGlobalMonitorable().

69  {
70  name_ = monitorable->getName();
71  tracked_ = (void const *)monitorable;
72  if (dynamic_cast<IntJ const *>(monitorable))
73  monType_ = TYPEINT;
74  else if (dynamic_cast<DoubleJ const *>(monitorable))
76  else if (dynamic_cast<StringJ const *>(monitorable))
78  else
79  assert(0);
80  NAifZeroUpdates_ = NAifZeroUpdates;
81 }
assert(be >=bs)
void const * tracked_
Definition: DataPoint.h:128
void DataPoint::trackVectorUInt ( std::string const &  name,
std::vector< unsigned int > const *  monvec,
bool  NAifZeroUpdates 
)
void DataPoint::trackVectorUIntAtomic ( std::string const &  name,
std::vector< AtomicMonUInt * > const *  monvec,
bool  NAifZeroUpdates 
)
void jsoncollector::DataPoint::updateDefinition ( std::string const &  definition)
inline

Definition at line 113 of file DataPoint.h.

References definition_.

113 { definition_ = definition; }
std::string definition_
Definition: DataPoint.h:123

Member Data Documentation

uint32_t* jsoncollector::DataPoint::buf_ = nullptr
protected

Definition at line 144 of file DataPoint.h.

Referenced by mergeAndSerialize(), and ~DataPoint().

unsigned int jsoncollector::DataPoint::bufLen_ = 0
protected

Definition at line 145 of file DataPoint.h.

Referenced by mergeAndSerialize().

int jsoncollector::DataPoint::cacheI_
protected

Definition at line 148 of file DataPoint.h.

Referenced by mergeAndRetrieveValue(), and mergeAndSerialize().

const std::string DataPoint::DATA = "data"
static
std::vector<std::string> jsoncollector::DataPoint::data_
protected

Definition at line 124 of file DataPoint.h.

Referenced by deserialize(), getData(), and serialize().

const std::string DataPoint::DEFINITION = "definition"
static
std::string jsoncollector::DataPoint::definition_
protected
unsigned int jsoncollector::DataPoint::fastIndex_ = 0
protected

Definition at line 151 of file DataPoint.h.

Referenced by fastOutCSV().

MonPtrMap jsoncollector::DataPoint::globalDataMap_
protected

Definition at line 127 of file DataPoint.h.

Referenced by discardCollected(), mergeAndSerialize(), and snapGlobal().

bool jsoncollector::DataPoint::isAtomic_ = false
protected

Definition at line 134 of file DataPoint.h.

Referenced by fastOutCSV(), snap(), snapStreamAtomic(), and trackVectorUIntAtomic().

bool jsoncollector::DataPoint::isCached_ = false
protected
bool jsoncollector::DataPoint::isDummy_ = false
protected

Definition at line 135 of file DataPoint.h.

Referenced by mergeAndSerialize(), and trackDummy().

bool jsoncollector::DataPoint::isFastOnly_
protected

Definition at line 137 of file DataPoint.h.

bool jsoncollector::DataPoint::isStream_ = false
protected
MonType jsoncollector::DataPoint::monType_
protected
bool jsoncollector::DataPoint::NAifZeroUpdates_ = false
protected
std::string jsoncollector::DataPoint::name_
protected
unsigned int* jsoncollector::DataPoint::nBinsPtr_ = nullptr
protected

Definition at line 147 of file DataPoint.h.

Referenced by mergeAndSerialize(), setNBins(), snap(), and snapStreamAtomic().

OperationType jsoncollector::DataPoint::opType_
protected

Definition at line 140 of file DataPoint.h.

Referenced by mergeAndSerialize(), setOperation(), snap(), and snapStreamAtomic().

const std::string DataPoint::SOURCE = "source"
static
std::string jsoncollector::DataPoint::source_
protected
std::vector<MonPtrMap> jsoncollector::DataPoint::streamDataMaps_
protected
std::vector<unsigned int>* jsoncollector::DataPoint::streamLumisPtr_ = nullptr
protected

Definition at line 131 of file DataPoint.h.

Referenced by setStreamLumiPtr(), and snap().

void const* jsoncollector::DataPoint::tracked_ = nullptr
protected