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::ldmsd_stream_publish_plugin Class Reference

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

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

Public Member Functions

 ldmsd_stream_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
 
 ~ldmsd_stream_publish_plugin ()
 

Static Public Attributes

static const char * adc_ldmsd_stream_publish_plugin_directory_default = "/dev/shm/adc"
 scratch directory for ldmsd_stream_publish utility messages This directory must be globally writable and should be fast. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_DIRECTORY").
 
static const char * adc_ldmsd_stream_publish_plugin_prog_default = "/usr/sbin/ldmsd_stream_publish"
 full path to ldmsd_stream_publish utility This program should be world accessible. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_PROG").
 
static const char * adc_ldmsd_stream_publish_plugin_stream_default = "adc_publish_api"
 name of the stream ADC messages go into LDMS aggregators must be subscribed to this name. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_STREAM").
 
static const char * adc_ldmsd_stream_publish_plugin_auth_default = "munge"
 authentication method for stream connections; ldmsd listeners must match. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_AUTH").
 
static const char * adc_ldmsd_stream_publish_plugin_port_default = "412"
 port for stream connections; ldmsd listeners must match. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_PORT").
 
static const char * adc_ldmsd_stream_publish_plugin_host_default = "localhost"
 host for stream connections; ldmsd must be listening on the host. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_HOST").
 
static const char * adc_ldmsd_stream_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_LDMSD_STREAM_PUBLISH_PLUGIN_AFFINITY").
 
static const char * adc_ldmsd_stream_publish_plugin_debug_default = "0"
 ADC ldmsd-stream plugin enable debug messages; (default "0": none) Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_DEBUG").
 

Detailed Description

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

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 ldmsd_stream_publish.ipp.

Constructor & Destructor Documentation

◆ ldmsd_stream_publish_plugin()

adc::ldmsd_stream_publish_plugin::ldmsd_stream_publish_plugin ( )
inline

Definition at line 182 of file ldmsd_stream_publish.ipp.

◆ ~ldmsd_stream_publish_plugin()

adc::ldmsd_stream_publish_plugin::~ldmsd_stream_publish_plugin ( )
inline

Definition at line 295 of file ldmsd_stream_publish.ipp.

Member Function Documentation

◆ publish()

int adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

◆ config() [1/2]

int adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

◆ config() [2/2]

int adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

◆ get_option_defaults()

const std::map< const std::string, const std::string > & adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

◆ initialize()

int adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

◆ finalize()

void adc::ldmsd_stream_publish_plugin::finalize ( )
inlinevirtual

Stop publishing and release any resources held for managing publication.

Implements adc::publisher_api.

Definition at line 267 of file ldmsd_stream_publish.ipp.

◆ pause()

void adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

◆ resume()

void adc::ldmsd_stream_publish_plugin::resume ( )
inlinevirtual

Resume publishing Duplicate calls are allowed.

Implements adc::publisher_api.

Definition at line 283 of file ldmsd_stream_publish.ipp.

◆ name()

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

Implements adc::publisher_api.

Definition at line 287 of file ldmsd_stream_publish.ipp.

◆ version()

string_view adc::ldmsd_stream_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 ldmsd_stream_publish.ipp.

Member Data Documentation

◆ adc_ldmsd_stream_publish_plugin_directory_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_directory_default = "/dev/shm/adc"
inlinestatic

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

Definition at line 42 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_prog_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_prog_default = "/usr/sbin/ldmsd_stream_publish"
inlinestatic

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

Definition at line 47 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_stream_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_stream_default = "adc_publish_api"
inlinestatic

name of the stream ADC messages go into LDMS aggregators must be subscribed to this name. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_STREAM").

Definition at line 52 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_auth_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_auth_default = "munge"
inlinestatic

authentication method for stream connections; ldmsd listeners must match. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_AUTH").

Definition at line 56 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_port_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_port_default = "412"
inlinestatic

port for stream connections; ldmsd listeners must match. Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_PORT").

Definition at line 60 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_host_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_host_default = "localhost"
inlinestatic

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

Definition at line 64 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_affinity_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_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_LDMSD_STREAM_PUBLISH_PLUGIN_AFFINITY").

Definition at line 70 of file ldmsd_stream_publish.ipp.

◆ adc_ldmsd_stream_publish_plugin_debug_default

const char* adc::ldmsd_stream_publish_plugin::adc_ldmsd_stream_publish_plugin_debug_default = "0"
inlinestatic

ADC ldmsd-stream plugin enable debug messages; (default "0": none) Overridden with env("ADC_LDMSD_STREAM_PUBLISH_PLUGIN_DEBUG").

Definition at line 74 of file ldmsd_stream_publish.ipp.


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