QualityControl  1.5.1
O2 Data Quality Control Framework
o2::quality_control::core::ServiceDiscovery Class Reference

Information service for QC. More...

#include <ServiceDiscovery.h>

Collaboration diagram for o2::quality_control::core::ServiceDiscovery:

Public Member Functions

 ServiceDiscovery (const std::string &url, const std::string &name, const std::string &id, const std::string &healthEndpoint=GetDefaultUrl())
 
 ~ServiceDiscovery ()
 Stops the health thread and deregisteres from Consul health checks.
 
void _register (const std::string &objects)
 
void deregister ()
 Deregisters service.
 

Static Public Member Functions

static std::string GetDefaultUrl ()
 
static std::string GetDefaultUrl (size_t port)
 

Static Public Attributes

static constexpr size_t DefaultHealthPort = 7777
 Health check default port.
 

Detailed Description

Information service for QC.

Register a endpoint to Consul which then performs health checks it Allow to publish list of online objects

Constructor & Destructor Documentation

o2::quality_control::core::ServiceDiscovery::ServiceDiscovery ( const std::string &  url,
const std::string &  name,
const std::string &  id,
const std::string &  healthEndpoint = GetDefaultUrl() 
)

Sets up CURL and health check

Parameters
urlConsul URL
nameService name
idUnique instance ID
healthEndpointLocal endpoint that is then used for health checks (default value it set to <hostname>:7777)

Member Function Documentation

void o2::quality_control::core::ServiceDiscovery::_register ( const std::string &  objects)

Registers list of online objects by sending HTTP PUT request to Consul server

Parameters
objectsList of comma separated objects
static std::string o2::quality_control::core::ServiceDiscovery::GetDefaultUrl ( size_t  port)
inlinestatic
Parameters
portProvides default health check URL

The documentation for this class was generated from the following files: