Skip to content

Commit c41474b

Browse files
authored
Fix the path to consul (QC-249) (#259)
1 parent d7da06e commit c41474b

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

Framework/include/QualityControl/MonitorObject.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ class MonitorObject : public TObject
147147
void Draw(Option_t* option) override;
148148
TObject* DrawClone(Option_t* option) const override;
149149

150+
/// \brief Build the path to this object.
151+
/// Build the path to this object as it will appear in the GUI.
152+
/// \return A string containing the path.
153+
std::string getPath() const;
154+
150155
private:
151156
TObject* mObject;
152157
std::map<std::string /*checkName*/, CheckDefinition> mChecks;

Framework/src/CcdbDatabase.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void CcdbDatabase::store(std::shared_ptr<o2::quality_control::core::MonitorObjec
116116
}
117117

118118
// other attributes
119-
string path = "qc/" + mo->getDetectorName() + "/" + mo->getTaskName() + "/" + mo->getName();
119+
string path = mo->getPath();
120120
long from = getCurrentTimestamp();
121121
long to = getFutureTimestamp(60 * 60 * 24 * 365 * 10);
122122

Framework/src/MonitorObject.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,10 @@ std::map<std::string, std::string> MonitorObject::getMetadataMap() const
121121
return mUserMetadata;
122122
}
123123

124+
std::string MonitorObject::getPath() const
125+
{
126+
string path = "qc/" + getDetectorName() + "/" + getTaskName() + "/" + getName();
127+
return path;
128+
}
129+
124130
} // namespace o2::quality_control::core

Framework/src/ObjectsManager.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ void ObjectsManager::updateServiceDiscovery()
6363
}
6464
// prepare the string of comma separated objects and publish it
6565
string objects;
66-
for (auto mo : *mMonitorObjects) {
67-
objects += mTaskConfig.taskName + "/" + mo->GetName() + ",";
66+
for (auto tobj : *mMonitorObjects) {
67+
MonitorObject* mo = dynamic_cast<MonitorObject*>(tobj);
68+
objects += mo->getPath() + ",";
6869
}
6970
objects.pop_back();
7071
mServiceDiscovery->_register(objects);

0 commit comments

Comments
 (0)