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 ()
 
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 *monitorable, bool NAifZeroUpdates)
 
void trackVectorUInt (std::string const &name, std::vector< unsigned int > *monvec, bool NAifZeroUpdates)
 
void trackVectorUIntAtomic (std::string const &name, std::vector< AtomicMonUInt * > *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 * tracked_ = nullptr
 

Detailed Description

Definition at line 36 of file DataPoint.h.

Constructor & Destructor Documentation

jsoncollector::DataPoint::DataPoint ( )
inline

Definition at line 40 of file DataPoint.h.

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

Definition at line 42 of file DataPoint.h.

References deserialize(), serialize(), and ~DataPoint().

42  :
43  source_(source), definition_(definition), isFastOnly_(fast) { }
std::string definition_
Definition: DataPoint.h:128
static std::string const source
Definition: EdmProvDump.cc:44
DataPoint::~DataPoint ( )
override

Definition at line 31 of file DataPoint.cc.

References buf_.

Referenced by DataPoint().

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

Member Function Documentation

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

JSON deserialization procedure for this class

Implements jsoncollector::JsonSerializable.

Definition at line 56 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 DataPoint(), evf::EvFDaqDirector::getNFilesFromEoLS(), evf::EvFDaqDirector::grabNextJsonFile(), and evf::EvFDaqDirector::grabNextJsonFileAndUnlock().

57 {
58  source_ = root.get(SOURCE, "").asString();
59  definition_ = root.get(DEFINITION, "").asString();
60  if (root.get(DATA, "").isArray()) {
61  unsigned int size = root.get(DATA, "").size();
62  for (unsigned int i = 0; i < size; i++) {
63  data_.push_back(root.get(DATA, "")[i].asString());
64  }
65  }
66 }
size
Write out results.
Value get(UInt index, const Value &defaultValue) const
static const std::string SOURCE
Definition: DataPoint.h:121
std::string definition_
Definition: DataPoint.h:128
static const std::string DATA
Definition: DataPoint.h:123
UInt size() const
Number of values in array or object.
bool isArray() const
std::vector< std::string > data_
Definition: DataPoint.h:129
std::string asString() const
static const std::string DEFINITION
Definition: DataPoint.h:122
void DataPoint::discardCollected ( unsigned int  forLumi)

Definition at line 413 of file DataPoint.cc.

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

Referenced by setStreamLumiPtr().

414 {
415  for (unsigned int i=0;i<streamDataMaps_.size();i++)
416  {
417  auto itr = streamDataMaps_[i].find(lumi);
418  if (itr!=streamDataMaps_[i].end()) streamDataMaps_[i].erase(lumi);
419  }
420 
421  auto itr = globalDataMap_.find(lumi);
422  if (itr!=globalDataMap_.end())
423  globalDataMap_.erase(lumi);
424 }
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:131
#define end
Definition: vmac.h:39
std::string DataPoint::fastOutCSV ( int  sid = -1)

Definition at line 251 of file DataPoint.cc.

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

Referenced by setStreamLumiPtr().

252 {
253  if (tracked_) {
254  if (isStream_) {
255  std::stringstream ss;
256  if (sid<0) {
257  if (isAtomic_) {
258 // if ATOMIC_LEVEL>0
259 // ss << (unsigned int) (static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->at(fastIndex_)->load(std::memory_order_relaxed);
260 
261  ss << (unsigned int) *((static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->at(fastIndex_));
262  fastIndex_ = (fastIndex_+1) % (static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->size();
263  }
264  else {
265  ss << (static_cast<std::vector<unsigned int>*>(tracked_))->at(fastIndex_);
266  fastIndex_ = (fastIndex_+1) % (static_cast<std::vector<unsigned int>*>(tracked_))->size();
267  }
268 
269  }
270  else {
271  if (isAtomic_)
272  ss << (unsigned int) *((static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->at(unsigned(sid)));
273  else
274  ss << (static_cast<std::vector<unsigned int>*>(tracked_))->at(unsigned(sid));
275  }
276  return ss.str();
277  }
278  return (static_cast<JsonMonitorable*>(tracked_))->toString();
279  }
280  return std::string("");
281 }
size
Write out results.
unsigned int fastIndex_
Definition: DataPoint.h:156
std::vector<std::string>& jsoncollector::DataPoint::getData ( void  )
inline
std::string& jsoncollector::DataPoint::getDefinition ( )
inline
std::string const& jsoncollector::DataPoint::getName ( void  )
inline

Definition at line 116 of file DataPoint.h.

References name_.

Referenced by plotting.Plot::draw().

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

Definition at line 107 of file DataPoint.cc.

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

Referenced by trackDummy(), trackVectorUInt(), and trackVectorUIntAtomic().

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

Definition at line 283 of file DataPoint.cc.

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

Referenced by setStreamLumiPtr().

284 {
285  assert(monType_==TYPEUINT && isStream_);//for now only support UINT and SUM for stream variables
286  IntJ *newJ = new IntJ;
287  for (unsigned int i=0;i<streamDataMaps_.size();i++) {
288  auto itr = streamDataMaps_[i].find(lumi);
289  if (itr!=streamDataMaps_[i].end()) {
290  newJ->add(static_cast<IntJ*>(itr->second.get())->value());
291  }
292  }
293  cacheI_=newJ->value();
294  isCached_=true;
295  return newJ;//assume the caller takes care of deleting the object
296 }
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:131
void add(long sth)
#define end
Definition: vmac.h:39
void DataPoint::mergeAndSerialize ( Json::Value jsonRoot,
unsigned int  lumi,
bool  initJsonValue,
int  sid 
)

Definition at line 298 of file DataPoint.cc.

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

Referenced by setStreamLumiPtr().

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

JSON serialization procedure for this class

Implements jsoncollector::JsonSerializable.

Definition at line 43 of file DataPoint.cc.

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

Referenced by DataPoint(), and getDefinition().

44 {
45  if (!source_.empty()) {
46  root[SOURCE] = source_;
47  }
48  if (!definition_.empty()) {
49  root[DEFINITION] = definition_;
50  }
51  for (unsigned int i=0;i<data_.size();i++)
52  root[DATA].append(data_[i]);
53 }
static const std::string SOURCE
Definition: DataPoint.h:121
std::string definition_
Definition: DataPoint.h:128
static const std::string DATA
Definition: DataPoint.h:123
std::vector< std::string > data_
Definition: DataPoint.h:129
static const std::string DEFINITION
Definition: DataPoint.h:122
void DataPoint::serialize ( Json::Value root,
bool  rootInit,
std::string const &  input 
) const

Functions specific to new monitoring implementation

Definition at line 114 of file DataPoint.cc.

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

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

Definition at line 92 of file DataPoint.h.

References opType_.

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

Definition at line 97 of file DataPoint.h.

References discardCollected(), fastOutCSV(), mergeAndRetrieveValue(), mergeAndSerialize(), streamLumisPtr_, and AlCaHLTBitMon_QueryRunRegistry::string.

97  {
98  streamLumisPtr_=streamLumiPtr;
99  }
std::vector< unsigned int > * streamLumisPtr_
Definition: DataPoint.h:136
void DataPoint::snap ( unsigned int  lumi)

Definition at line 125 of file DataPoint.cc.

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

Referenced by getDefinition().

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

Definition at line 175 of file DataPoint.cc.

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

Referenced by getDefinition(), and snap().

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

Definition at line 206 of file DataPoint.cc.

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

Referenced by getDefinition().

207 {
208  if (!isStream_ || !isAtomic_) return;
209  isCached_=false;
210  if (monType_==TYPEUINT)
211  {
212  unsigned int monVal;
213 #if ATOMIC_LEVEL>0
214  if (isAtomic_) monVal = (static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->at(streamID)->load(std::memory_order_relaxed);
215 #else
216  if (isAtomic_) monVal = *((static_cast<std::vector<AtomicMonUInt*>*>(tracked_))->at(streamID));
217 #endif
218  else monVal = (static_cast<std::vector<unsigned int>*>(tracked_))->at(streamID);
219 
220  auto itr = streamDataMaps_[streamID].find(lumi);
221  if (itr==streamDataMaps_[streamID].end()) //insert
222  {
223  if (opType_==OPHISTO) {
224  if (*nBinsPtr_) {
226  h->update(monVal);
227  streamDataMaps_[streamID][lumi] = h;
228  }
229  }
230  else {//default to SUM
231 
232  IntJ *h = new IntJ;
233  h->update(monVal);
234  streamDataMaps_[streamID][lumi] = h;
235  }
236  }
237  else
238  {
239  if (opType_==OPHISTO) {
240  if (*nBinsPtr_) {
241  static_cast<HistoJ<unsigned int>*>(itr->second.get())->update(monVal);
242  }
243  }
244  else
245  *(static_cast<IntJ*>(itr->second.get()))=monVal;
246  }
247  }
248  else assert(monType_!=TYPEINT);//not yet implemented
249 }
OperationType opType_
Definition: DataPoint.h:145
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
#define MAXUPDATES
Definition: DataPoint.cc:16
std::vector< MonPtrMap > streamDataMaps_
Definition: DataPoint.h:131
#define end
Definition: vmac.h:39
void update(long sth)
#define update(a, b)
unsigned int * nBinsPtr_
Definition: DataPoint.h:152
void jsoncollector::DataPoint::trackDummy ( std::string const &  name,
bool  setNAifZeroUpdates 
)
inline

Definition at line 82 of file DataPoint.h.

References isDummy_, makeStreamLumiMap(), NAifZeroUpdates_, dataset::name, name_, and findQualityFiles::size.

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

83  {
84  name_ = name;
85  isDummy_=true;
86  NAifZeroUpdates_=true;
87  }
void DataPoint::trackMonitorable ( JsonMonitorable monitorable,
bool  NAifZeroUpdates 
)

Definition at line 74 of file DataPoint.cc.

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

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

75 {
76  name_=monitorable->getName();
77  tracked_ = (void*)monitorable;
78  if (dynamic_cast<IntJ*>(monitorable)) monType_=TYPEINT;
79  else if (dynamic_cast<DoubleJ*>(monitorable)) monType_=TYPEDOUBLE;
80  else if (dynamic_cast<StringJ*>(monitorable)) monType_=TYPESTRING;
81  else assert(0);
82  NAifZeroUpdates_=NAifZeroUpdates;
83 
84 }
virtual std::string & getName()
void DataPoint::trackVectorUInt ( std::string const &  name,
std::vector< unsigned int > *  monvec,
bool  NAifZeroUpdates 
)
void DataPoint::trackVectorUIntAtomic ( std::string const &  name,
std::vector< AtomicMonUInt * > *  monvec,
bool  NAifZeroUpdates 
)
void jsoncollector::DataPoint::updateDefinition ( std::string const &  definition)
inline

Definition at line 118 of file DataPoint.h.

References definition_.

118 {definition_=definition;}
std::string definition_
Definition: DataPoint.h:128

Member Data Documentation

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

Definition at line 149 of file DataPoint.h.

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

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

Definition at line 150 of file DataPoint.h.

Referenced by mergeAndSerialize().

int jsoncollector::DataPoint::cacheI_
protected

Definition at line 153 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 129 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 156 of file DataPoint.h.

Referenced by fastOutCSV().

MonPtrMap jsoncollector::DataPoint::globalDataMap_
protected

Definition at line 132 of file DataPoint.h.

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

bool jsoncollector::DataPoint::isAtomic_ = false
protected

Definition at line 139 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 140 of file DataPoint.h.

Referenced by mergeAndSerialize(), and trackDummy().

bool jsoncollector::DataPoint::isFastOnly_
protected

Definition at line 142 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 152 of file DataPoint.h.

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

OperationType jsoncollector::DataPoint::opType_
protected

Definition at line 145 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 136 of file DataPoint.h.

Referenced by setStreamLumiPtr(), and snap().

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