libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
adc::ldms_message_publish_plugin Class Reference

ldms_message_publish utility publisher_api implementation. This plugin generates a scratch file (in-memory) and asynchronously sends it to ldmsd by invoking the 'ldms_message_publish' utility available in ldms versions from 4.5. Use the ldmsd_stream_publish_plugin for ldms versions 4.4 and below. More...

Inheritance diagram for adc::ldms_message_publish_plugin:
Inheritance graph
[legend]
Collaboration diagram for adc::ldms_message_publish_plugin:
Collaboration graph
[legend]

Public Member Functions

 ldms_message_publish_plugin ()
 
int publish (std::shared_ptr< builder_api > b)
 Publish the content of the builder.
 
int config (const std::map< std::string, std::string > &m)
 Configure the plugin with the options given.
 
int config (const std::map< std::string, std::string > &m, string_view env_prefix)
 Configure the plugin with the options given and the corresponding environment variables.
 
const std::map< const std::string, const std::string > & get_option_defaults ()
 Look up the settable options and their defaults.
 
int initialize ()
 Ready the plugin to publish following the configuration options set or defaulted.
 
void finalize ()
 Stop publishing and release any resources held for managing publication.
 
void pause ()
 Pause publishing until a call to resume. Duplicate calls are allowed.
 
void resume ()
 Resume publishing Duplicate calls are allowed.
 
string_view name () const
 
string_view version () const
 
 ~ldms_message_publish_plugin ()
 

Static Public Attributes

static const char * adc_ldms_message_publish_plugin_directory_default = "/dev/shm/adc"
 scratch directory for ldms_message_publish utility messages This directory must be globally writable and should be fast. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_DIRECTORY").
 
static const char * adc_ldms_message_publish_plugin_prog_default = "/usr/sbin/ldms_msg_publish"
 full path to ldms_message_publish utility This program should be world accessible. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_PROG").
 
static const char * adc_ldms_message_publish_plugin_channel_default = "adc_publish_api"
 channel of the ADC messages published LDMS aggregators must be subscribed to this name. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_CHANNEL").
 
static const char * adc_ldms_message_publish_plugin_auth_default = "munge"
 authentication method for ldms message connections; ldmsd listeners must match. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_AUTH").
 
static const char * adc_ldms_message_publish_plugin_port_default = "412"
 port for message connections; ldmsd listeners must match. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_PORT").
 
static const char * adc_ldms_message_publish_plugin_host_default = "localhost"
 host for message connections; ldmsd must be listening on the host. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_HOST").
 
static const char * adc_ldms_message_publish_plugin_affinity_default = "all"
 affinity for spawned processes; defaults to all If not all, it should be a range list of cpu numbers, e,g. "0-1,56-57" on a 56 core hyperthreaded processor where admin tools should run on 2 lowest cores. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_AFFINITY").
 
static const char * adc_ldms_message_publish_plugin_debug_default = "0"
 ADC ldms-message plugin enable debug messages; (default "0": none) Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_DEBUG").
 

Detailed Description

ldms_message_publish utility publisher_api implementation. This plugin generates a scratch file (in-memory) and asynchronously sends it to ldmsd by invoking the 'ldms_message_publish' utility available in ldms versions from 4.5. Use the ldmsd_stream_publish_plugin for ldms versions 4.4 and below.

Multiple independent instances of this plugin may be used simultaneously. The asynchronous tranmission spawns a separate shell process to handle tranmission and file cleanup.

Definition at line 27 of file ldms_message_publish.ipp.

Constructor & Destructor Documentation

◆ ldms_message_publish_plugin()

adc::ldms_message_publish_plugin::ldms_message_publish_plugin ( )
inline

Definition at line 182 of file ldms_message_publish.ipp.

◆ ~ldms_message_publish_plugin()

adc::ldms_message_publish_plugin::~ldms_message_publish_plugin ( )
inline

Definition at line 295 of file ldms_message_publish.ipp.

Member Function Documentation

◆ publish()

int adc::ldms_message_publish_plugin::publish ( std::shared_ptr< builder_api b)
inlinevirtual

Publish the content of the builder.

Parameters
bconverted to a single json object and published

Implements adc::publisher_api.

Definition at line 185 of file ldms_message_publish.ipp.

◆ config() [1/2]

int adc::ldms_message_publish_plugin::config ( const std::map< std::string, std::string > &  m)
inlinevirtual

Configure the plugin with the options given.

Parameters
ma map with keys documented in the plugin-specific header.

For plugin QQQ, Environment variables ADC_QQQ_PLUGIN_* will override the source code default for any key not defined in m. Here QQQ is the uppercase version of the plugin name.

Implements adc::publisher_api.

Definition at line 220 of file ldms_message_publish.ipp.

◆ config() [2/2]

int adc::ldms_message_publish_plugin::config ( const std::map< std::string, std::string > &  m,
string_view  env_prefix 
)
inlinevirtual

Configure the plugin with the options given and the corresponding environment variables.

Parameters
ma map with keys documented in the plugin-specific header.
env_prefixis prepended to the expected keys for the plugin and values found with getenv that match are used, overriding elements of m. Typically, env_prefix will be PPP_ADC_QQQ_PLUGIN_ if application PPP wants to override the defaults of plugin QQQ. Here QQQ is the uppercase version of the plugin name.

Implements adc::publisher_api.

Definition at line 224 of file ldms_message_publish.ipp.

◆ get_option_defaults()

const std::map< const std::string, const std::string > & adc::ldms_message_publish_plugin::get_option_defaults ( )
inlinevirtual

Look up the settable options and their defaults.

Some plugins without options will return an empty map.

Implements adc::publisher_api.

Definition at line 235 of file ldms_message_publish.ipp.

◆ initialize()

int adc::ldms_message_publish_plugin::initialize ( )
inlinevirtual

Ready the plugin to publish following the configuration options set or defaulted.

Implements adc::publisher_api.

Definition at line 239 of file ldms_message_publish.ipp.

◆ finalize()

void adc::ldms_message_publish_plugin::finalize ( )
inlinevirtual

Stop publishing and release any resources held for managing publication.

Implements adc::publisher_api.

Definition at line 267 of file ldms_message_publish.ipp.

◆ pause()

void adc::ldms_message_publish_plugin::pause ( )
inlinevirtual

Pause publishing until a call to resume. Duplicate calls are allowed.

Implements adc::publisher_api.

Definition at line 279 of file ldms_message_publish.ipp.

◆ resume()

void adc::ldms_message_publish_plugin::resume ( )
inlinevirtual

Resume publishing Duplicate calls are allowed.

Implements adc::publisher_api.

Definition at line 283 of file ldms_message_publish.ipp.

◆ name()

string_view adc::ldms_message_publish_plugin::name ( ) const
inlinevirtual
Returns
the name of the plugin

Implements adc::publisher_api.

Definition at line 287 of file ldms_message_publish.ipp.

◆ version()

string_view adc::ldms_message_publish_plugin::version ( ) const
inlinevirtual
Returns
the version of the plugin (should follow semantic versioning practices)

Implements adc::publisher_api.

Definition at line 291 of file ldms_message_publish.ipp.

Member Data Documentation

◆ adc_ldms_message_publish_plugin_directory_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_directory_default = "/dev/shm/adc"
inlinestatic

scratch directory for ldms_message_publish utility messages This directory must be globally writable and should be fast. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_DIRECTORY").

Definition at line 42 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_prog_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_prog_default = "/usr/sbin/ldms_msg_publish"
inlinestatic

full path to ldms_message_publish utility This program should be world accessible. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_PROG").

Definition at line 47 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_channel_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_channel_default = "adc_publish_api"
inlinestatic

channel of the ADC messages published LDMS aggregators must be subscribed to this name. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_CHANNEL").

Definition at line 52 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_auth_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_auth_default = "munge"
inlinestatic

authentication method for ldms message connections; ldmsd listeners must match. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_AUTH").

Definition at line 56 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_port_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_port_default = "412"
inlinestatic

port for message connections; ldmsd listeners must match. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_PORT").

Definition at line 60 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_host_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_host_default = "localhost"
inlinestatic

host for message connections; ldmsd must be listening on the host. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_HOST").

Definition at line 64 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_affinity_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_affinity_default = "all"
inlinestatic

affinity for spawned processes; defaults to all If not all, it should be a range list of cpu numbers, e,g. "0-1,56-57" on a 56 core hyperthreaded processor where admin tools should run on 2 lowest cores. Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_AFFINITY").

Definition at line 70 of file ldms_message_publish.ipp.

◆ adc_ldms_message_publish_plugin_debug_default

const char* adc::ldms_message_publish_plugin::adc_ldms_message_publish_plugin_debug_default = "0"
inlinestatic

ADC ldms-message plugin enable debug messages; (default "0": none) Overridden with env("ADC_LDMS_MESSAGE_PUBLISH_PLUGIN_DEBUG").

Definition at line 74 of file ldms_message_publish.ipp.


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