Adds immediate migration results

This commit is contained in:
torsten committed 2026-08-18 22:12:24 +02:00
1 parent ba4121728b
commit 6a2a0667ab
2395 files changed
+357322 -2524

No files matched your search

@@ -0,0 +1,6 @@
#ifndef RTI_MONITORING_COLLECTOR_SERVICE_HPP_
#define RTI_MONITORING_COLLECTOR_SERVICE_HPP_
#include <rti/monitoring/collector/Service.hpp>
#endif // RTI_MONITORING_COLLECTOR_SERVICE_HPP_
@@ -0,0 +1,40 @@
/*
* (c) Copyright, Real-Time Innovations, 2021.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef monitoringcollector_dll_h
#define monitoringcollector_dll_h
#if defined(RTI_WIN32) || defined(RTI_WINCE) || defined(RTI_INTIME)
#if defined(RTI_collectorservice_DLL_EXPORT)
#define COLLECTORSERVICEDllExport __declspec( dllexport )
#else
#define COLLECTORSERVICEDllExport
#endif /* RTI_collectorservice_DLL_EXPORT */
#if defined(RTI_collectorservice_DLL_VARIABLE)
#if defined(RTI_collectorservice_DLL_EXPORT)
#define COLLECTORSERVICEDllVariable __declspec( dllexport )
#else
#define COLLECTORSERVICEDllVariable __declspec( dllimport )
#endif /* RTI_collectorservice_DLL_EXPORT */
#else
#define COLLECTORSERVICEDllVariable
#endif /* RTI_collectorservice_DLL_VARIABLE */
#elif defined(RTI_VISIBILITY_HIDDEN)
#define COLLECTORSERVICEDllExport __attribute__((visibility("default")))
#define COLLECTORSERVICEDllVariable __attribute__((visibility("default")))
#else
#define COLLECTORSERVICEDllExport
#define COLLECTORSERVICEDllVariable
#endif /* RTI_WIN32 || RTI_WINCE || RTI_INTIME */
#endif /* monitoringcollector_dll_h */
@@ -0,0 +1,85 @@
/*
* (c) Copyright, Real-Time Innovations, 2021.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef monitoringcollector_log_h
#define monitoringcollector_log_h
#ifndef monitoringcollector_dll_h
#include <rti/monitoring/collector/Dll.h>
#endif
#ifndef log_common_h
#include "log/log_common.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*i \ingroup COLLECTORSERVICELogModule
Submodule ID for Monitoring Collector Configuration submodule
*/
#define SUBMODULE_COLLECTORSERVICE_CONFIG (0x1000)
/*i \ingroup COLLECTORSERVICELogModule
Submodule ID for Monitoring Collector service submodule
*/
#define SUBMODULE_COLLECTORSERVICE_SERVICE (0x2000)
/*i \ingroup COLLECTORSERVICELogModule
Submodule ID for Monitoring Collector Adapters submodule
*/
#define SUBMODULE_COLLECTORSERVICE_ADAPTERS (0x3000)
/*i \ingroup COLLECTORSERVICELogModule
Submodule ID for Monitoring Collector wrapper application submodule
*/
#define SUBMODULE_COLLECTORSERVICE_APP (0x4000)
/*i \ingroup COLLECTORSERVICELogModule
Submodule ID for Monitoring Collector processor submodule
*/
#define SUBMODULE_COLLECTORSERVICE_PROCESSORS (0x5000)
/*i \ingroup COLLECTORSERVICELogModule
Mask for turning on logging for only the Monitoring Collector Configuration submodule
*/
#define COLLECTORSERVICE_SUBMODULE_MASK_CONFIG (0x0001)
/*i \ingroup COLLECTORSERVICELogModule
Mask for turning on logging for only the Monitoring Collector Configuration submodule
*/
#define COLLECTORSERVICE_SUBMODULE_MASK_SERVICE (0x0002)
/*i \ingroup COLLECTORSERVICELogModule
Mask for turning on logging for only the Monitoring Collector Adapters submodule
*/
#define COLLECTORSERVICE_SUBMODULE_MASK_ADAPTERS (0x0004)
/*i \ingroup COLLECTORSERVICELogModule
Mask for turning on logging for only the Monitoring Collector Application submodule
*/
#define COLLECTORSERVICE_SUBMODULE_MASK_APP (0x0008)
/*i \ingroup COLLECTORSERVICELogModule
Mask for turning on logging for only the Monitoring Collector Application submodule
*/
#define COLLECTORSERVICE_SUBMODULE_MASK_PROCESSORS (0x000A)
/*i \ingroup COLLECTORSERVICELogModule
Mask for turning on logging for all submodules
*/
#define COLLECTORSERVICE_SUBMODULE_MASK_ALL RTI_LOG_SUBMODULE_MASK_ALL
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* monitoringcollector_log_h */
@@ -0,0 +1,172 @@
/*
* (c) Copyright, Real-Time Innovations, 2021.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef RTI_MONITORING_COLLECTOR_LOGGER_HPP_
#define RTI_MONITORING_COLLECTOR_LOGGER_HPP_
#include <rti/monitoring/collector/Dll.h>
#include <dds/core/Reference.hpp>
#include <rti/config/Logger.hpp>
namespace rti { namespace monitoring { namespace collector {
/** \ingroup RTI_MonitoringCollectorServiceLibModule
*
* @brief The singleton type used to configure @product verbosity
*
* For configuring other aspects such as output file, print format or
* RTI Connext specific logging, use rti::config::Logger.
*
*/
class Logger {
public:
typedef rti::config::Verbosity Verbosity;
typedef rti::config::LogCategory LogCategory;
typedef rti::config::PrintFormat PrintFormat;
static Logger& instance();
/**
* @brief Logs as message with EXCEPTION level
*
* The generated log will be part of logging stream of the running service
* if the service verbosity contains EXCEPTION messages. The result log
* message may include additional information according to the
* Connext logging configuration, such as Advlog Context, thread ID,
* line number, etc. Additionally, the result log message will contain a
* newline character at the end, so the format does not need to contain it.
*
* @param[in] msg Message to be logged
*/
void error(const std::string& msg);
/**
* @brief overload of error(const std::string& msg)
*/
void error(const char *msg);
/**
* @brief Logs as message with WARNING level
*
* This operation behaves similar to error() except the log level is
* WARNING.
*
* @param[in] msg Message to be logged
*
* @see rti::monitoring::collector::Logger::error
*
*/
void warn(const std::string& msg);
/**
* @brief overload of warn(const std::string& msg)
*/
void warn(const char *msg);
/**
* @brief Logs as message with WARNING level
*
* This operation behaves similar to error() except the log level is
* STATUS_LOCAL.
*
* @param[in] msg Message to be logged
*
* @see rti::monitoring::collector::Logger::error
*
*/
void local(const std::string& msg);
/**
* @brief overload of local(const std::string& msg)
*/
void local(const char *msg);
/**
* @brief Logs as message with WARNING level
*
* This operation behaves similar to error() except the log level is
* STATUS_REMOTE.
*
* @param[in] msg Message to be logged
*
* @see rti::monitoring::collector::Logger::error
*
*/
void remote(const std::string& msg);
/**
* @brief overload of remote(const std::string& msg)
*/
void remote(const char *msg);
/**
* @brief Logs as message with WARNING level
*
* This operation behaves similar to error() except the log level is
* STATUS_DEBUG.
*
* @param[in] msg Message to be logged
*
* @see rti::monitoring::collector::Logger::error
*
*/
void debug(const std::string& msg);
/**
* @brief overload of debug(const std::string& msg)
*/
void debug(const char *msg);
/**
* @brief Sets the verbosity for the log messages generated at the
* @product level.
*
* @param[in] verbosity
* The verbosity of the service logs
*/
void service_verbosity(rti::config::Verbosity verbosity);
/**
* @brief Getter for the same attribute
*
* @see verbosity(rti::config::Verbosity)
*/
rti::config::Verbosity service_verbosity();
/**
* @deprecated
* @see service_verbosity
*/
void verbosity(rti::config::Verbosity verbosity);
/**
* @deprecated
* @see service_verbosity
*/
rti::config::Verbosity verbosity();
virtual ~Logger();
private:
void message(const rti::config::LogLevel& level, const char* msg);
Logger();
// Disable copy
Logger(const Logger&);
Logger& operator=(const Logger&);
};
} } }
#endif // RTI_MONITORING_COLLECTOR_LOGGER_HPP_
@@ -0,0 +1,13 @@
#ifndef RTI_COLLECTOR_PROPERTYSET_HPP
#define RTI_COLLECTOR_PROPERTYSET_HPP
#include <rti/routing/PropertySet.hpp>
namespace rti { namespace monitoring { namespace collector {
typedef rti::routing::PropertySet PropertySet;
} } }
#endif /* RTI_COLLECTOR_PROPERTYSET_HPP */
@@ -0,0 +1,209 @@
/*
* (c) Copyright, Real-Time Innovations, 2022.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef RTI_COLLECTOR_SERVICE_HPP_
#define RTI_COLLECTOR_SERVICE_HPP_
#include <dds/core/Reference.hpp>
#include <rti/config/Logger.hpp>
#include <rti/monitoring/collector/Logger.hpp>
#include <rti/monitoring/collector/ServiceProperty.hpp>
#include <rti/monitoring/collector/detail/CollectorServiceImpl.hpp>
namespace rti { namespace monitoring { namespace collector {
/*e \defgroup RTI_CollectorServiceLibModule RTI Monitoring Collector API
*
* @brief @product can be deployed as a native library linked into your
* application in select architectures.
*
* This API allows you to create, configure and start @product instances from
* your application.
*
* The following code shows the typical use of the API:
*
* \code
*
* int main ()
* {
* rti::monitoring::collector::Service service(
* rti::monitoring::collector::ServiceProperty()
* .cfg_file("MyCollectorService.xml")
* .service_name("MyCollectorService"));
* ...
*
* service.start();
*
* while(keep_running) {
* sleep();
* ...
* }
*
* return 0;
* }
*
* \endcode
*
* Instead of a file, you can use XML strings to configure @product.
* See ServiceProperty for more information.
* <p>
* To build your application you need to link with the @product native library
* in <b> &lt;@ndds home&gt;/bin/&lt;architecture&gt;/ </b>.
*
* ### Development Requirements
*
* | | Linux Systems | Windows Systems |
* | --------------: | :----------------: | :-------------: |
* | Shared Libraries| libnddscpp2.so | nddscpp2.dll |
* | Shared Libraries| librtiroutingservice.so | rtiroutingservice.dll |
* | ^ | librtirsinfrastructure.so | rtirsinfrastructure.dll |
* | ^ | librticollectorservice.so | rticollectorservice.dll |
* | ^ | librtidlc.so | rtidlc.dll |
* | ^ | libnddsmetp.so | nddsmetp.dll |
* | ^ | libnddsc.so | nddsc.dll |
* | ^ | librtixml2.so | rtixml2.dll |
* | ^ | libnddscore.so | nddscore.dll |
* | Headers | rti/monitoring/collector/RecordingService.hpp ||
*
*/
/** \ingroup RTI_CollectorServiceLibModule
*
* @brief The @product.
*
*/
class Service : public dds::core::Reference<ServiceImpl> {
public:
typedef dds::core::Reference<ServiceImpl> Base;
OMG_DDS_REF_TYPE_NOTYPENAME(
Service,
dds::core::Reference,
ServiceImpl);
/**
* @brief Creates a @product instance
*
* @param[in] property
* The property to configure @product instance.
*
* @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks):
* UNSAFE for multiple threads to simultaneously make the FIRST
* call to any of the Service constructors. Subsequent calls are
* thread safe.
* On Windows and Linux systems, these calls are thread-safe.
*/
explicit Service(const ServiceProperty& property)
: Base(new ServiceImpl(property))
{
this->delegate()->remember_reference(this->delegate());
}
/**
* @brief Creates a @product instance
*
* A callable shutdown hook can optionally be provided to handle the
* shutdown command received through remote administration. Upon reception
* of this command, @product will notify the installed hook.
*
* The following example shows simple implementation of a shutdown hook
* that sets a boolean flag to true when invoked:
*
* \code
*
* // Hook implmentation
* struct FlagShutdownHook {
* public:
* FlagShutdownHook(bool& the_flag) : flag(the_flag)
* {
* flag = false;
* }
* void operator()() {
* the_flag = true;
* }
*
* bool& flag;
* };
*
* // Instantiate service with hook
* bool my_flag;
* rti::monitoring::collector::Service collector_service_instance(
* property,
* FlagShutdownHook(my_flag));
* ...
*
*
* \endcode
*
* @param[in] property
* The property to configure @product instance.
*
* @param[in] shutdown_hook
* Callable object to handle the shutdown command. The expected
* type is a void operator()() (C++11 equivalent is
* std::function<void()>)
*
* @mtsafety On non-Linux, non-Windows systems (i.e. VxWorks):
* UNSAFE for multiple threads to simultaneously make the FIRST
* call to any of the Service constructors. Subsequent calls are
* thread safe.
* On Windows and Linux systems, these calls are thread-safe.
*/
template <typename HookFunc>
explicit Service(
const ServiceProperty& property,
const HookFunc& shutdown_hook)
: Base(new ServiceImpl(
property,
new rti::routing::detail::ShutdownHookForwarder<HookFunc>(
shutdown_hook)))
{
this->delegate()->remember_reference(this->delegate());
}
explicit Service(Base::DELEGATE_REF_T reference) : Base(reference)
{
if (this->delegate()) {
this->delegate()->remember_reference(this->delegate());
}
}
virtual ~Service() = default;
/**
* @brief Starts @product.
*
* This is a non-blocking operation. @product will create its own set of
* threads to perform its tasks.
*/
void start()
{
this->delegate()->start();
}
/**
* @brief Stops @product.
*
* This operation will bloc the instance is fully stopped.
*/
void stop()
{
this->delegate()->stop();
}
};
typedef Service CollectorService;
} } }
#endif // RTI_COLLECTOR_SERVICE_HPP_
@@ -0,0 +1,316 @@
/*
* (c) Copyright, Real-Time Innovations, 2021.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef HPP_SERVICE_SERVICEPROPERTY_HPP_
#define HPP_SERVICE_SERVICEPROPERTY_HPP_
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstdint>
#include <map>
#include "osapi/osapi_type.h"
#include "routingservice/routingservice_infrastructure.h"
#include "routingservice/routingservice_service.h"
#include <dds/core/SafeEnumeration.hpp>
#include <rti/monitoring/collector/PropertySet.hpp>
namespace rti { namespace monitoring { namespace collector {
typedef rti::routing::PropertySet PropertySet;
/** \ingroup RTI_MonitoringCollectorLibModule
*
* @brief Configuration for a @product object.
*
*/
class ServiceProperty {
public:
/**
* @brief Creates a property object with default settings.
*/
ServiceProperty() :
cfg_file_(""),
service_name_(""),
application_name_(""),
domain_id_base_(0),
enable_service_monitoring_(false),
service_monitoring_domain_id_(0),
enforce_xsd_validation_(true),
ignore_default_files_(false)
{
}
static ServiceProperty default_property()
{
ServiceProperty default_property;
default_property.service_name("default");
return default_property;
}
/**
* @brief Getter (see setter with the same name)
*/
const std::string& cfg_file() const
{
return cfg_file_;
}
/**
* @brief Path to an @product configuration file
*
* @default empty string.
*/
ServiceProperty& cfg_file(const std::string & cfg_file)
{
cfg_file_ = cfg_file;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
const std::string & service_name() const
{
return service_name_;
}
/**
* @brief The name of the @product configuration to run.
*
* This is the name used to find the service XML tag in the configuration
* file; the name that will be used to refer to this execution in remote
* administration and
* monitoring.
*
* @default empty string.
*/
ServiceProperty& service_name(const std::string & service_name)
{
service_name_ = service_name;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
const std::string & application_name() const
{
return application_name_;
}
/**
* @brief Assigns a name to the execution of the @product.
*
* Remote commands and status information will refer to the service using
* this name.
*
* In addition, the name of DomainParticipants created by @product will be
* based on this name.
*
* @default empty string.
* If no application name is specified, @product will use
* ServiceProperty::service_name.
*
*/
ServiceProperty& application_name(const std::string & application_name)
{
application_name_ = application_name;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
int32_t domain_id_base() const
{
return domain_id_base_;
}
/**
* @brief Getter (see setter with the same name)
*/
bool enforce_xsd_validation() const
{
return enforce_xsd_validation_;
}
/**
* @brief Controls whether the service applies XSD validation to the loaded
* configuration.
*
* @default true
*/
ServiceProperty& enforce_xsd_validation(bool enforce)
{
enforce_xsd_validation_ = enforce;
return *this;
}
/**
* @brief Value that is added to the domain IDs of the
* domain routes in the XML configuration.
*
* By using this, an XML file can use relative domain IDs.
*
* @default 0
*/
ServiceProperty& domain_id_base(int32_t domain_id)
{
domain_id_base_ = domain_id;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
bool enable_service_monitoring() const
{
return enable_service_monitoring_;
}
/**
* @brief Set it to true to enable remote monitoring
* or false to disable it.
*
* @default false
*/
ServiceProperty& enable_service_monitoring(bool enable_monitoring)
{
enable_service_monitoring_ = enable_monitoring;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
int32_t service_monitoring_domain_id() const
{
return service_monitoring_domain_id_;
}
/**
* @brief If ServiceProperty::enable_monitoring is true, this is
* the domain ID to use for remote monitoring.
*
* Takes precedence over the XML configuration.
* If ServiceProperty::enable_monitoring is false, this value is not used,
* even if remote monitoring is enabled in the XML configuration.
*
* @default 0
*/
ServiceProperty& service_monitoring_domain_id(int32_t domain_id)
{
service_monitoring_domain_id_ = domain_id;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
bool ignore_default_files() const
{
return ignore_default_files_;
}
/**
* @brief Set it to true to avoid loading the
* standard files usually loaded by @product.
*
* Only the configuration in ServiceProperty::cfg_file or
* ServiceProperty::cfg_strings will be loaded.
*
* @default false
*/
ServiceProperty& ignore_default_files(bool ignore)
{
ignore_default_files_ = ignore;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
const std::string& license_file() const
{
return license_file_;
}
/**
* @brief Path to an RTI Connext license file. This parameter is only used
* if your installation requires a license file.
*
* @default empty string.
*/
ServiceProperty& license_file(const std::string& license_file)
{
license_file_ = license_file;
return *this;
}
/**
* @brief Getter (see setter with the same name)
*/
const PropertySet& user_environment() const
{
return user_env_;
}
/**
* @brief Non-const getter for modification that can be used to add
* elements individually. (see setter with the same name)
*/
PropertySet& user_environment()
{
return user_env_;
}
/**
* @brief Dictionary of user variables.
* The dictionary provides a parallel way to expand XML configuration
* variables in the form $(my_var), when they are not defined in the
* environment.
*
* @default empty
*/
ServiceProperty& user_environment(const PropertySet& user_environment)
{
user_env_ = user_environment;
return *this;
}
private:
std::string cfg_file_;
std::string service_name_;
std::string application_name_;
int32_t domain_id_base_;
bool enable_service_monitoring_;
int32_t service_monitoring_domain_id_;
bool enforce_xsd_validation_;
bool ignore_default_files_;
std::string license_file_;
PropertySet user_env_;
};
} } } /* namespace rti::monitoring::collector */
#endif /* HPP_SERVICE_SERVICEPROPERTY_HPP_ */
@@ -0,0 +1,63 @@
/*
* (c) Copyright, Real-Time Innovations, 2021.
* All rights reserved.
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef RTI_MONITORING_COLLECTOR_SERVICE_IMPL_HPP_
#define RTI_MONITORING_COLLECTOR_SERVICE_IMPL_HPP_
#include <rti/monitoring/collector/Dll.h>
#include <dds/core/refmacros.hpp>
#include <rti/core/detail/SelfReference.hpp>
#include <rti/monitoring/collector/ServiceProperty.hpp>
#include <rti/routing/detail/ShutdownHookForwarder.hpp>
namespace rti { namespace monitoring { namespace collector {
namespace service {
class Service;
}
namespace detail {
typedef rti::routing::detail::AbstractShutdownHookForwarder
AbstractShutdownHookForwarder;
}
class Application;
// class COLLECTORSERVICEDllExport ServiceImpl
class COLLECTORSERVICEDllExport ServiceImpl
: public rti::core::detail::RetainableType<ServiceImpl> {
public:
explicit ServiceImpl(const ServiceProperty& property);
ServiceImpl(
const ServiceProperty& property,
detail::AbstractShutdownHookForwarder *hook_forwarder);
virtual ~ServiceImpl();
void start();
void stop();
private:
friend class rti::monitoring::collector::Application;
rti::monitoring::collector::service::Service *impl_;
detail::AbstractShutdownHookForwarder *shutdown_forwarder_fwd_;
};
} } }
#endif // RTI_MONITORING_COLLECTOR_SERVICE_IMPL_HPP_