CMS 3D CMS Logo

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

◆ DataPoint() [1/2]

jsoncollector::DataPoint::DataPoint ( )
inline

Definition at line 38 of file DataPoint.h.

38 {}

◆ DataPoint() [2/2]

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:49

◆ ~DataPoint()

DataPoint::~DataPoint ( )
override

Definition at line 29 of file DataPoint.cc.

References buf_.

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

Member Function Documentation

◆ deserialize()

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

JSON deserialization procedure for this class

Implements jsoncollector::JsonSerializable.

Definition at line 51 of file DataPoint.cc.

References DATA, data_, DEFINITION, definition_, mps_fire::i, findQualityFiles::size, SOURCE, and source_.

51  {
52  source_ = root.get(SOURCE, "").asString();
53  definition_ = root.get(DEFINITION, "").asString();
54  if (root.get(DATA, "").isArray()) {
55  unsigned int size = root.get(DATA, "").size();
56  for (unsigned int i = 0; i < size; i++) {
57  data_.push_back(root.get(DATA, "")[i].asString());
58  }
59  }
60 }
size
Write out results.
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
std::vector< std::string > data_
Definition: DataPoint.h:124
static const std::string DEFINITION
Definition: DataPoint.h:117

◆ discardCollected()

void DataPoint::discardCollected ( unsigned int  forLumi)

Definition at line 405 of file DataPoint.cc.

References globalDataMap_, mps_fire::i, and streamDataMaps_.

405  {
406  for (unsigned int i = 0; i < streamDataMaps_.size(); i++) {
407  auto itr = streamDataMaps_[i].find(lumi);
408  if (itr != streamDataMaps_[i].end())
409  streamDataMaps_[i].erase(lumi);
410  }
411 
412  auto itr = globalDataMap_.find(lumi);
413  if (itr != globalDataMap_.end())
414  globalDataMap_.erase(lumi);
415 }
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126

◆ fastOutCSV()

std::string DataPoint::fastOutCSV ( int  sid = -1)

Definition at line 244 of file DataPoint.cc.

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

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

◆ getData()

std::vector<std::string>& jsoncollector::DataPoint::getData ( void  )
inline

Definition at line 56 of file DataPoint.h.

References data_.

56 { return data_; }
std::vector< std::string > data_
Definition: DataPoint.h:124

◆ getDefinition()

std::string& jsoncollector::DataPoint::getDefinition ( )
inline

Definition at line 57 of file DataPoint.h.

References definition_.

57 { return definition_; }
std::string definition_
Definition: DataPoint.h:123

◆ getName()

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_; }

◆ makeStreamLumiMap()

void DataPoint::makeStreamLumiMap ( unsigned int  size)

Definition at line 105 of file DataPoint.cc.

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

Referenced by trackVectorUInt(), and trackVectorUIntAtomic().

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

◆ mergeAndRetrieveValue()

JsonMonitorable * DataPoint::mergeAndRetrieveValue ( unsigned int  forLumi)

Definition at line 273 of file DataPoint.cc.

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

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

◆ mergeAndSerialize()

void DataPoint::mergeAndSerialize ( Json::Value jsonRoot,
unsigned int  lumi,
bool  initJsonValue,
int  sid 
)

Definition at line 287 of file DataPoint.cc.

References cms::cuda::assert(), buf_, bufLen_, cacheI_, DATA, DEFINITION, definition_, jsoncollector::JsonMonitorable::getUpdates(), globalDataMap_, mps_fire::i, createfilelist::int, 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().

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

◆ serialize() [1/2]

void DataPoint::serialize ( Json::Value root) const
overridevirtual

JSON serialization procedure for this class

Implements jsoncollector::JsonSerializable.

Definition at line 40 of file DataPoint.cc.

References mps_setup::append, DATA, data_, DEFINITION, definition_, mps_fire::i, SOURCE, and source_.

40  {
41  if (!source_.empty()) {
42  root[SOURCE] = source_;
43  }
44  if (!definition_.empty()) {
46  }
47  for (unsigned int i = 0; i < data_.size(); i++)
48  root[DATA].append(data_[i]);
49 }
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
std::vector< std::string > data_
Definition: DataPoint.h:124
static const std::string DEFINITION
Definition: DataPoint.h:117

◆ serialize() [2/2]

void DataPoint::serialize ( Json::Value root,
bool  rootInit,
std::string const &  input 
) const

Functions specific to new monitoring implementation

Definition at line 111 of file DataPoint.cc.

References DATA, DEFINITION, definition_, input, SOURCE, and source_.

111  {
112  if (rootInit) {
113  if (!source_.empty())
114  root[SOURCE] = source_;
115  if (!definition_.empty())
117  }
118  root[DATA].append(input);
119 }
static const std::string SOURCE
Definition: DataPoint.h:116
std::string definition_
Definition: DataPoint.h:123
static std::string const input
Definition: EdmProvDump.cc:50
static const std::string DATA
Definition: DataPoint.h:118
static const std::string DEFINITION
Definition: DataPoint.h:117

◆ setNBins()

void jsoncollector::DataPoint::setNBins ( unsigned int *  nBins)
inline

◆ setOperation()

void jsoncollector::DataPoint::setOperation ( OperationType  op)
inline

Definition at line 91 of file DataPoint.h.

References findAndChange::op, and opType_.

91 { opType_ = op; }
OperationType opType_
Definition: DataPoint.h:140

◆ setStreamLumiPtr()

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

◆ snap()

void DataPoint::snap ( unsigned int  lumi)

Definition at line 121 of file DataPoint.cc.

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

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

◆ snapGlobal()

void DataPoint::snapGlobal ( unsigned int  lumi)

Definition at line 169 of file DataPoint.cc.

References globalDataMap_, isCached_, isStream_, BXlumiParameters_cfi::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().

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

◆ snapStreamAtomic()

void DataPoint::snapStreamAtomic ( unsigned int  lumi,
unsigned int  streamID 
)

Definition at line 200 of file DataPoint.cc.

References cms::cuda::assert(), h, isAtomic_, isCached_, isStream_, BXlumiParameters_cfi::lumi, MAXUPDATES, monType_, nBinsPtr_, jsoncollector::OPHISTO, opType_, streamDataMaps_, tracked_, jsoncollector::TYPEINT, jsoncollector::TYPEUINT, and update.

200  {
201  if (!isStream_ || !isAtomic_)
202  return;
203  isCached_ = false;
204  if (monType_ == TYPEUINT) {
205  unsigned int monVal;
206 #if ATOMIC_LEVEL > 0
207  if (isAtomic_)
208  monVal =
209  (static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(streamID)->load(std::memory_order_relaxed);
210 #else
211  if (isAtomic_)
212  monVal = *((static_cast<std::vector<AtomicMonUInt *> const *>(tracked_))->at(streamID));
213 #endif
214  else
215  monVal = (static_cast<std::vector<unsigned int> const *>(tracked_))->at(streamID);
216 
217  auto itr = streamDataMaps_[streamID].find(lumi);
218  if (itr == streamDataMaps_[streamID].end()) //insert
219  {
220  if (opType_ == OPHISTO) {
221  if (*nBinsPtr_) {
223  h->update(monVal);
224  streamDataMaps_[streamID][lumi] = h;
225  }
226  } else { //default to SUM
227 
228  IntJ *h = new IntJ;
229  h->update(monVal);
230  streamDataMaps_[streamID][lumi] = h;
231  }
232  } else {
233  if (opType_ == OPHISTO) {
234  if (*nBinsPtr_) {
235  static_cast<HistoJ<unsigned int> *>(itr->second.get())->update(monVal);
236  }
237  } else
238  *(static_cast<IntJ *>(itr->second.get())) = monVal;
239  }
240  } else
241  assert(monType_ != TYPEINT); //not yet implemented
242 }
OperationType opType_
Definition: DataPoint.h:140
assert(be >=bs)
#define MAXUPDATES
Definition: DataPoint.cc:15
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:126
void const * tracked_
Definition: DataPoint.h:128
#define update(a, b)
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

◆ trackDummy()

void jsoncollector::DataPoint::trackDummy ( std::string const &  name,
bool  setNAifZeroUpdates 
)
inline

Definition at line 82 of file DataPoint.h.

References isDummy_, NAifZeroUpdates_, Skims_PA_cff::name, and name_.

Referenced by jsoncollector::FastMonitor::commit().

82  {
83  name_ = name;
84  isDummy_ = true;
85  NAifZeroUpdates_ = true;
86  }

◆ trackMonitorable()

void DataPoint::trackMonitorable ( JsonMonitorable const *  monitorable,
bool  NAifZeroUpdates 
)

Definition at line 68 of file DataPoint.cc.

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

68  {
69  name_ = monitorable->getName();
70  tracked_ = (void const *)monitorable;
71  if (dynamic_cast<IntJ const *>(monitorable))
72  monType_ = TYPEINT;
73  else if (dynamic_cast<DoubleJ const *>(monitorable))
75  else if (dynamic_cast<StringJ const *>(monitorable))
77  else
78  assert(0);
79  NAifZeroUpdates_ = NAifZeroUpdates;
80 }
assert(be >=bs)
void const * tracked_
Definition: DataPoint.h:128

◆ trackVectorUInt()

void DataPoint::trackVectorUInt ( std::string const &  name,
std::vector< unsigned int > const *  monvec,
bool  NAifZeroUpdates 
)

Definition at line 82 of file DataPoint.cc.

References isStream_, makeStreamLumiMap(), monType_, NAifZeroUpdates_, Skims_PA_cff::name, name_, tracked_, and jsoncollector::TYPEUINT.

84  {
85  name_ = name;
86  tracked_ = (void const *)monvec;
87  isStream_ = true;
89  NAifZeroUpdates_ = NAifZeroUpdates;
90  makeStreamLumiMap(monvec->size());
91 }
void const * tracked_
Definition: DataPoint.h:128
void makeStreamLumiMap(unsigned int size)
Definition: DataPoint.cc:105

◆ trackVectorUIntAtomic()

void DataPoint::trackVectorUIntAtomic ( std::string const &  name,
std::vector< AtomicMonUInt *> const *  monvec,
bool  NAifZeroUpdates 
)

Definition at line 93 of file DataPoint.cc.

References isAtomic_, isStream_, makeStreamLumiMap(), monType_, NAifZeroUpdates_, Skims_PA_cff::name, name_, tracked_, and jsoncollector::TYPEUINT.

95  {
96  name_ = name;
97  tracked_ = (void const *)monvec;
98  isStream_ = true;
99  isAtomic_ = true;
100  monType_ = TYPEUINT;
101  NAifZeroUpdates_ = NAifZeroUpdates;
102  makeStreamLumiMap(monvec->size());
103 }
void const * tracked_
Definition: DataPoint.h:128
void makeStreamLumiMap(unsigned int size)
Definition: DataPoint.cc:105

◆ updateDefinition()

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

◆ buf_

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

Definition at line 144 of file DataPoint.h.

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

◆ bufLen_

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

Definition at line 145 of file DataPoint.h.

Referenced by mergeAndSerialize().

◆ cacheI_

int jsoncollector::DataPoint::cacheI_
protected

Definition at line 148 of file DataPoint.h.

Referenced by mergeAndRetrieveValue(), and mergeAndSerialize().

◆ DATA

const std::string DataPoint::DATA = "data"
static

◆ data_

std::vector<std::string> jsoncollector::DataPoint::data_
protected

Definition at line 124 of file DataPoint.h.

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

◆ DEFINITION

const std::string DataPoint::DEFINITION = "definition"
static

◆ definition_

std::string jsoncollector::DataPoint::definition_
protected

◆ fastIndex_

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

Definition at line 151 of file DataPoint.h.

Referenced by fastOutCSV().

◆ globalDataMap_

MonPtrMap jsoncollector::DataPoint::globalDataMap_
protected

Definition at line 127 of file DataPoint.h.

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

◆ isAtomic_

bool jsoncollector::DataPoint::isAtomic_ = false
protected

Definition at line 134 of file DataPoint.h.

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

◆ isCached_

bool jsoncollector::DataPoint::isCached_ = false
protected

◆ isDummy_

bool jsoncollector::DataPoint::isDummy_ = false
protected

Definition at line 135 of file DataPoint.h.

Referenced by mergeAndSerialize(), and trackDummy().

◆ isFastOnly_

bool jsoncollector::DataPoint::isFastOnly_
protected

Definition at line 137 of file DataPoint.h.

◆ isStream_

bool jsoncollector::DataPoint::isStream_ = false
protected

◆ monType_

MonType jsoncollector::DataPoint::monType_
protected

◆ NAifZeroUpdates_

bool jsoncollector::DataPoint::NAifZeroUpdates_ = false
protected

◆ name_

std::string jsoncollector::DataPoint::name_
protected

◆ nBinsPtr_

unsigned int* jsoncollector::DataPoint::nBinsPtr_ = nullptr
protected

Definition at line 147 of file DataPoint.h.

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

◆ opType_

OperationType jsoncollector::DataPoint::opType_
protected

Definition at line 140 of file DataPoint.h.

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

◆ SOURCE

const std::string DataPoint::SOURCE = "source"
static

◆ source_

std::string jsoncollector::DataPoint::source_
protected

◆ streamDataMaps_

std::vector<MonPtrMap> jsoncollector::DataPoint::streamDataMaps_
protected

◆ streamLumisPtr_

std::vector<unsigned int>* jsoncollector::DataPoint::streamLumisPtr_ = nullptr
protected

Definition at line 131 of file DataPoint.h.

Referenced by setStreamLumiPtr(), and snap().

◆ tracked_

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