Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Framework/include/QualityControl/TaskInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <Framework/InitContext.h>
#include <Framework/ProcessingContext.h>
#include <CCDB/CcdbApi.h>
#include <Monitoring/Monitoring.h>
// QC
#include "QualityControl/Activity.h"
#include "QualityControl/ObjectsManager.h"
Expand Down Expand Up @@ -87,6 +88,7 @@ class TaskInterface
void setObjectsManager(std::shared_ptr<ObjectsManager> objectsManager);
void setName(const std::string& name);
void setCustomParameters(const std::unordered_map<std::string, std::string>& parameters);
void setMonitoring(const std::shared_ptr<o2::monitoring::Monitoring>& mMonitoring);
const std::string& getName() const;

protected:
Expand All @@ -97,11 +99,11 @@ class TaskInterface
long timestamp = -1) const;

std::unordered_map<std::string, std::string> mCustomParameters;
std::shared_ptr<o2::monitoring::Monitoring> mMonitoring;

private:
// TODO should we rather have a global/singleton for the objectsManager ?
std::shared_ptr<ObjectsManager> mObjectsManager;
std::string mName;
std::shared_ptr<ObjectsManager> mObjectsManager;
std::shared_ptr<o2::ccdb::CcdbApi> mCcdbApi;
};

Expand Down
5 changes: 5 additions & 0 deletions Framework/src/TaskInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ TObject* TaskInterface::retrieveCondition(std::string path, std::map<std::string

std::shared_ptr<ObjectsManager> TaskInterface::getObjectsManager() { return mObjectsManager; }

void TaskInterface::setMonitoring(const std::shared_ptr<o2::monitoring::Monitoring>& mMonitoring)
{
TaskInterface::mMonitoring = mMonitoring;
}

} // namespace o2::quality_control::core
1 change: 1 addition & 0 deletions Framework/src/TaskRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void TaskRunner::init(InitContext& iCtx)
// setup user's task
TaskFactory f;
mTask.reset(f.create(mTaskConfig, mObjectsManager));
mTask->setMonitoring(mCollector);

// init user's task
mTask->loadCcdb(mTaskConfig.conditionUrl);
Expand Down
2 changes: 0 additions & 2 deletions Modules/Skeleton/src/SkeletonTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include "Skeleton/SkeletonTask.h"
#include <Framework/InputRecord.h>

#include <Framework/InputRecord.h>

namespace o2::quality_control_modules::skeleton
{

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ For a general overview of our (O2) software, organization and processes, please
* [Readout](doc/ModulesDevelopment.md#readout)
* [DPL workflow](doc/ModulesDevelopment.md#dpl-workflow)
* [A more advanced example](doc/ModulesDevelopment.md#a-more-advanced-example)
* [Monitoring](doc/ModulesDevelopment.md#monitoring)
* [Post-processing](doc/PostProcessing.md)
* [The post-processing framework](doc/PostProcessing.md#the-post-processing-framework)
* [Post-processing interface](doc/PostProcessing.md#post-processing-interface)
Expand Down
12 changes: 12 additions & 0 deletions doc/ModulesDevelopment.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* [Readout](#readout)
* [DPL workflow](#dpl-workflow)
* [A more advanced example](#a-more-advanced-example)
* [Monitoring](#monitoring)

<!-- Added by: bvonhall, at: -->

Expand Down Expand Up @@ -525,6 +526,17 @@ or
o2-qc-run-advanced --no-qc | o2-qc --config json://${QUALITYCONTROL_ROOT}/etc/advanced.json
```

## Monitoring

The QC uses the [O2 Monitoring](https://github.com/AliceO2Group/Monitoring/) library to monitor metrics.
The user code has access to an instance of the Monitoring via the variable `mMonitoring`.
It can be used this way:
```
mMonitoring->send({ 42, "my/metric" }); // send the value 42 keyed with "my/metric"
```
By default the Monitoring will be printed in the terminal. If a proper Monitoring system
is setup, one can update the monitoring url in the config file to point to it.

---

[← Go back to Quickstart](QuickStart.md) | [↑ Go to the Table of Content ↑](../README.md) | [Continue to Post-processing →](PostProcessing.md)