libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
adc Namespace Reference

Namespaces

namespace  impl
 

Classes

class  builder
 Implementation of builder_api with optional (compile-time) support of MPI. If compiled without MPI, the mpi-related calls devolve to serial behavior. More...
 
class  builder_api
 The builder api is used to construct structured log (json) messages that follow naming conventions. More...
 
class  curl_plugin
 Curl utility publisher_api implementation. This plugin generates a scratch file (in-memory) and asynchronously sends it to the configured web service by invoking the 'curl' utility. Multiple independent instances of this plugin may be used simultaneously. More...
 
class  factory
 provides publishers and builders of application metadata. More...
 
struct  field
 
class  file_plugin
 File output publisher_api implementation. This plugin generates writes each message to the configured file, with <json></json> delimiters surrounding it. The output directory is "." by default, but may be overriden with a full path defined in env("ADC_FILE_PLUGIN_DIRECTORY"). The file name is adc.file_plugin.log by default, and may be overridden with a path name in env("ADC_FILE_PLUGIN_FILE"). The file is overwritten when the file_plugin is created, unless env("ADC_FILE_PLUGIN_APPEND") is "true". Debugging output is enabled if env("ADC_FILE_PLUGIN_DEBUG") is a number greater than 0. More...
 
struct  item
 
class  ldms_message_publish_plugin
 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...
 
class  ldmsd_stream_publish_plugin
 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...
 
class  libadiak_json_plugin
 Terminal output publisher_api implementation. This plugin sends messages to libadiak synchronously. Multiple independent instances of this plugin may be used simultaneously, but message integrity depends on the behavior of libadiak. More...
 
class  libadiak_many_plugin
 Terminal output publisher_api implementation. This plugin sends messages to libadiak synchronously. Multiple independent instances of this plugin may be used simultaneously, but message integrity depends on the behavior of libadiak_many. As of 6/2025, adiak objects assume the caller is single-threaded. More...
 
class  libcurl_plugin
 NOT yet implemented publisher plugin that will eventually use libcurl. More...
 
class  libldms_msg_publish_plugin
 libldms_msg_publish publisher_api implementation. This plugin calls the ldms libraries for sending messages. More...
 
class  multi_publisher
 
class  multi_publisher_api
 Interface for a group of publishers all being fed the same message(s). More...
 
class  multifile_plugin
 Parallel file output publisher_api implementation. This plugin generates writes each message to the configured directory tree with <json></json> delimiters surrounding it. The output directory is "." by default, but may be overriden with a full path defined in env("ADC_MULTIFILE_PLUGIN_DIRECTORY"). The resulting mass of files can be reduced independently later by concatenating all files in the tree or more selectively with a single call to the adc::multfile_assemble() function. More...
 
class  none_plugin
 Message suppression publisher; it quietly ignores all publication requests. More...
 
class  out_pipe
 
struct  pipe_data
 
class  publisher_api
 Publisher plugin interface. More...
 
class  script_plugin
 User script publisher plugin. The program specified by environment variable is used to asynchronously deliver published messages. It is invoked in a shell as: ($prog $messagefile > /dev/null 2>&1 || /bin/rm $messagefile) &. More...
 
class  stdout_plugin
 Terminal output publisher_api implementation. This plugin sends messages to stdout synchronously. Multiple independent instances of this plugin may be used simultaneously, but message integrity depends on the behavior of stdout. More...
 
class  syslog_plugin
 syslog publisher_api implementation. This plugin sends messages to syslog synchronously. Multiple independent instances of this plugin may be used simultaneously, but the underlying syslog setting (priority) will be that of the most recently created instance. More...
 
class  var_string
 return string for printing from variant v.
More...
 
struct  version
 A version with tags list. More...
 

Typedefs

typedef int32_t adc_hs_subsection_flags
 
typedef int32_t adc_mpi_field_flags
 
typedef std::string string
 
typedef std::string_view string_view
 
typedef std::map< const std::string, std::shared_ptr< publisher_api > > plugin_map
 name/plugin map.
 
typedef std::vector< std::shared_ptr< publisher_api > > publisher_vector
 list of publishers
 
typedef std::pair< std::string, std::shared_ptr< publisher_api > > pair_string_publisher_api
 named publisher
 
typedef std::variant< bool, char, char16_t, char32_t, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, float, double, std::complex< float >, std::complex< double >, std::array< int64_t, 2 >, std::string, std::shared_ptr< bool[]>, std::shared_ptr< char[]>, std::shared_ptr< char16_t[]>, std::shared_ptr< char32_t[]>, std::shared_ptr< int8_t[]>, std::shared_ptr< int16_t[]>, std::shared_ptr< int32_t[]>, std::shared_ptr< int64_t[]>, std::shared_ptr< uint8_t[]>, std::shared_ptr< uint16_t[]>, std::shared_ptr< uint32_t[]>, std::shared_ptr< uint64_t[]>, std::shared_ptr< float[]>, std::shared_ptr< double[]>, std::shared_ptr< std::complex< float >[]>, std::shared_ptr< std::complex< double >[]>, std::shared_ptr< std::string[]> > variant
 variant for querying builder data.
 

Enumerations

enum  scalar_type {
  cp_none , cp_bool , cp_char , cp_char16 ,
  cp_char32 , cp_cstr , cp_json_str , cp_yaml_str ,
  cp_xml_str , cp_json , cp_path , cp_number_str ,
  cp_uint8 , cp_uint16 , cp_uint32 , cp_uint64 ,
  cp_int8 , cp_int16 , cp_int32 , cp_int64 ,
  cp_f32 , cp_f64 , cp_f80 , cp_f128 ,
  cp_f8_e4m3 , cp_f8_e5m2 , cp_f16_e5m10 , cp_f16_e8m7 ,
  cp_c_f32 , cp_c_f64 , cp_c_f80 , cp_c_f128 ,
  cp_timespec , cp_timeval , cp_epoch , cp_last
}
 field types for scientific data encode/decode with json. More...
 
enum  key_type { k_none , k_section , k_value }
 when expanding scalar_type, always update enum.ipp to match. More...
 
enum  object_type { co_list = cp_last , co_map , co_array , co_scalar }
 classification of json-adjacent structure elements. This is not currently in use and may be retired soon. More...
 

Functions

std::string format_timespec_8601 (struct timespec &ts)
 
std::string format_timespec_utc_ns (struct timespec &ts)
 
size_t b64_length (size_t input_len)
 
size_t binary_length (size_t input_len)
 
unsigned char * base64 (const unsigned char *binary, size_t binary_len, unsigned char *b64buf, size_t b64buf_length)
 
unsigned char * decode64 (const unsigned char *b64buf, size_t b64buf_length, unsigned char *binary, size_t binary_len)
 
bool array_contains_string (boost::json::array &av, string_view uuid)
 
std::vector< std::string > split_string (const std::string &s, char delimiter)
 
std::string tolower_s (std::string s)
 
std::string get_exe (size_t bufsize)
 
std::string get_lscpu ()
 
std::string get_default_affinity ()
 
std::vector< std::string > get_libs (std::string_view)
 
boost::json::object get_numa_hardware ()
 
boost::json::object get_gpu_data ()
 
uint64_t get_memtotal ()
 
void update_meminfo ()
 
void fill_array_bool (field &f, boost::json::array &a)
 
void fill_array_string (field &f, boost::json::array &a)
 
boost::json::kind scalar_type_representation (scalar_type st)
 
scalar_type scalar_type_from_name (const std::string &name)
 get the enum representation of a scalar_type string
 
const std::string to_string (float)
 get string of float using to_chars.
 
const std::string to_string (double)
 get string of double using to_chars.
 
const std::string to_string (void *data, scalar_type cptype, size_t count)
 get string of array
 
const std::string to_string (scalar_type st)
 get the string representation of a scalar_type value
 
int test_enum_strings ()
 return non-zero if to_string and enum scalar_type are inconsisent.
 
std::vector< std::string > consolidate_multifile_logs (std::string_view dir, std::string_view match)
 
scalar_type adiak_type_to_adc_type (adiak_type_t at)
 
const string plugin_libcurl_prefix ("ADC_LIBCURL_PLUGIN_")
 
int get_priority_from_string (string s)
 

Variables

version builder_api_version ("1.0.0", {"none"})
 
version builder_version ("1.0.0", {"none"})
 
const size_t meminfo_raw = 9
 
version adc_factory_version ("1.0.0", {"none"})
 
std::map< const std::string, const std::string > libadiak_json_defaults
 
const std::map< string, stringplugin_libcurl_config_defaults
 
std::map< const std::string, const std::string > stdout_defaults
 
version multi_publisher_version (MULTI_PUBLISHER_VERSION, MULTI_PUBLISHER_TAGS)
 
version publisher_api_version ("1.0.0", {"none"})
 
version enum_version ("1.0.0", {"none"})
 the version number of enum scalar_type and object_type
 

Typedef Documentation

◆ string

typedef std::string adc::string

Definition at line 13 of file curl.ipp.

◆ string_view

typedef std::string_view adc::string_view

Definition at line 14 of file curl.ipp.

Function Documentation

◆ b64_length()

size_t adc::b64_length ( size_t  input_len)

Definition at line 13 of file b64.ipp.

◆ binary_length()

size_t adc::binary_length ( size_t  input_len)

Definition at line 20 of file b64.ipp.

◆ base64()

unsigned char * adc::base64 ( const unsigned char *  binary,
size_t  binary_len,
unsigned char *  b64buf,
size_t  b64buf_length 
)

Definition at line 27 of file b64.ipp.

◆ decode64()

unsigned char * adc::decode64 ( const unsigned char *  b64buf,
size_t  b64buf_length,
unsigned char *  binary,
size_t  binary_len 
)

Definition at line 42 of file b64.ipp.

◆ array_contains_string()

bool adc::array_contains_string ( boost::json::array &  av,
string_view  uuid 
)
Returns
true if uuid is in json array.

Definition at line 1412 of file builder.ipp.

◆ split_string()

std::vector< std::string > adc::split_string ( const std::string &  s,
char  delimiter 
)
Returns
values in s when split at delimiter.

Definition at line 428 of file builder.ipp.

◆ tolower_s()

std::string adc::tolower_s ( std::string  s)

Definition at line 27 of file builder.ipp.

◆ get_exe()

std::string adc::get_exe ( size_t  bufsize)

Definition at line 35 of file builder.ipp.

◆ get_lscpu()

std::string adc::get_lscpu ( )

Definition at line 72 of file builder.ipp.

◆ get_libs()

std::vector< std::string > adc::get_libs ( std::string_view  )

Definition at line 115 of file builder.ipp.

◆ get_numa_hardware()

boost::json::object adc::get_numa_hardware ( )

Definition at line 133 of file builder.ipp.

◆ get_gpu_data()

boost::json::object adc::get_gpu_data ( )

Definition at line 193 of file builder.ipp.

◆ get_memtotal()

uint64_t adc::get_memtotal ( )

Definition at line 315 of file builder.ipp.

◆ update_meminfo()

void adc::update_meminfo ( )

Definition at line 339 of file builder.ipp.

◆ fill_array_bool()

void adc::fill_array_bool ( field f,
boost::json::array &  a 
)

Definition at line 940 of file builder.ipp.

◆ fill_array_string()

void adc::fill_array_string ( field f,
boost::json::array &  a 
)

Definition at line 958 of file builder.ipp.

◆ scalar_type_representation()

boost::json::kind adc::scalar_type_representation ( scalar_type  st)

Definition at line 91 of file enums.ipp.

◆ adiak_type_to_adc_type()

scalar_type adc::adiak_type_to_adc_type ( adiak_type_t  at)

Definition at line 13 of file libadiak_many.ipp.

◆ plugin_libcurl_prefix()

const string adc::plugin_libcurl_prefix ( "ADC_LIBCURL_PLUGIN_"  )

◆ get_priority_from_string()

int adc::get_priority_from_string ( string  s)

Definition at line 17 of file syslog.ipp.

Variable Documentation

◆ builder_version

version adc::builder_version("1.0.0", {"none"}) ( "1.0.0"  ,
{"none"}   
)
inline

◆ meminfo_raw

const size_t adc::meminfo_raw = 9

Definition at line 312 of file builder.ipp.

◆ libadiak_json_defaults

std::map< const std::string, const std::string> adc::libadiak_json_defaults

Definition at line 8 of file libadiak_json.ipp.

◆ plugin_libcurl_config_defaults

const std::map< string, string > adc::plugin_libcurl_config_defaults
Initial value:
=
}
#define ADC_LIBCURL_PLUGIN_PORT_DEFAULT
Definition libcurl.ipp:16
#define ADC_LIBCURL_PLUGIN_URL_DEFAULT
Definition libcurl.ipp:17

Definition at line 19 of file libcurl.ipp.

◆ stdout_defaults

std::map< const std::string, const std::string> adc::stdout_defaults

Definition at line 10 of file stdout.ipp.