QualityControl  1.5.1
O2 Data Quality Control Framework
RepositoryBenchmark.h
Go to the documentation of this file.
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
15 
16 #ifndef QC_REPOSITORYBENCHMARK_H
17 #define QC_REPOSITORYBENCHMARK_H
18 
20 #include <fairmq/FairMQDevice.h>
21 #include <TH1.h>
22 #include <Monitoring/MonitoringFactory.h>
23 #include <boost/asio.hpp>
24 #include <thread>
25 #include <string>
26 
28 {
29 
31 {
32  public:
33  RepositoryBenchmark() = default;
34  virtual ~RepositoryBenchmark() = default;
35 
36  protected:
37  virtual void InitTask();
38  virtual bool ConditionalRun();
39  void emptyDatabase();
40  void checkTimedOut();
41  TH1* createHisto(uint64_t sizeObjects, std::string name);
42 
43  private:
44  // user params
45  uint64_t mMaxIterations = 0;
46  uint64_t mNumIterations = 0;
47  uint64_t mNumberObjects = 1;
48  uint64_t mSizeObjects = 1;
49  std::string mTaskName;
50  std::string mObjectName;
51  bool mDeletionMode = false; // todo: is false ok as default?
52 
53  // monitoring
54  std::unique_ptr<o2::monitoring::Monitoring> mMonitoring;
55  uint64_t mTotalNumberObjects = 0;
56  bool mThreadedMonitoring = true;
57  uint64_t mThreadedMonitoringInterval = 10;
58 
59  // internal state
60  std::unique_ptr<o2::quality_control::repository::DatabaseInterface> mDatabase;
61  std::vector<std::shared_ptr<MonitorObject>> mMyObjects;
62  // TH1* mMyHisto;
63 
64  // variables for the timer
65  boost::asio::deadline_timer* mTimer;
66  boost::asio::io_service io;
67  std::thread* th;
68 };
69 
70 } // namespace o2::quality_control::core
71 
72 #endif // QC_REPOSITORYBENCHMARK_H
Definition: RepositoryBenchmark.h:30
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19