Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::trace_api_common_impl Struct Reference

Public Member Functions

void plugin_initialize (const appbase::variables_map &options)
 
void plugin_startup ()
 
void plugin_shutdown ()
 

Static Public Member Functions

static void set_program_options (appbase::options_description &cli, appbase::options_description &cfg)
 

Public Attributes

boost::filesystem::path trace_dir
 
uint32_t slice_stride = 0
 
std::optional< uint32_tminimum_irreversible_history_blocks
 
std::optional< uint32_tminimum_uncompressed_irreversible_history_blocks
 
std::shared_ptr< store_providerstore
 

Static Public Attributes

static constexpr int32_t manual_slice_file_value = -1
 
static constexpr uint32_t compression_seek_point_stride = 6 * 1024 * 1024
 

Detailed Description

A common source for information shared between the extraction process and the RPC process

Definition at line 103 of file trace_api_plugin.cpp.

Member Function Documentation

◆ plugin_initialize()

void sysio::trace_api_common_impl::plugin_initialize ( const appbase::variables_map & options)
inline

Definition at line 118 of file trace_api_plugin.cpp.

118 {
119 auto dir_option = options.at("trace-dir").as<bfs::path>();
120 if (dir_option.is_relative())
121 trace_dir = app().data_dir() / dir_option;
122 else
123 trace_dir = dir_option;
124 if (auto resmon_plugin = app().find_plugin<resource_monitor_plugin>())
125 resmon_plugin->monitor_directory(trace_dir);
126
127 slice_stride = options.at("trace-slice-stride").as<uint32_t>();
128
129 const int32_t blocks = options.at("trace-minimum-irreversible-history-blocks").as<int32_t>();
130 SYS_ASSERT(blocks >= -1, chain::plugin_config_exception,
131 "\"trace-minimum-irreversible-history-blocks\" must be greater to or equal to -1.");
132 if (blocks > manual_slice_file_value) {
134 }
135
136 const int32_t uncompressed_blocks = options.at("trace-minimum-uncompressed-irreversible-history-blocks").as<int32_t>();
137 SYS_ASSERT(uncompressed_blocks >= -1, chain::plugin_config_exception,
138 "\"trace-minimum-uncompressed-irreversible-history-blocks\" must be greater to or equal to -1.");
139
140 if (uncompressed_blocks > manual_slice_file_value) {
142 }
143
144 store = std::make_shared<store_provider>(
145 trace_dir,
150 );
151 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
bfs::path data_dir() const
Get data directory.
application & app()
unsigned int uint32_t
Definition stdint.h:126
signed int int32_t
Definition stdint.h:123
static constexpr int32_t manual_slice_file_value
boost::filesystem::path trace_dir
std::optional< uint32_t > minimum_irreversible_history_blocks
static constexpr uint32_t compression_seek_point_stride
std::shared_ptr< store_provider > store
std::optional< uint32_t > minimum_uncompressed_irreversible_history_blocks
Here is the call graph for this function:

◆ plugin_shutdown()

void sysio::trace_api_common_impl::plugin_shutdown ( )
inline

Definition at line 159 of file trace_api_plugin.cpp.

159 {
160 store->stop_maintenance_thread();
161 }

◆ plugin_startup()

void sysio::trace_api_common_impl::plugin_startup ( )
inline

Definition at line 153 of file trace_api_plugin.cpp.

153 {
154 store->start_maintenance_thread([](const std::string& msg ){
155 fc_dlog( _log, msg );
156 });
157 }
#define fc_dlog(LOGGER, FORMAT,...)
Definition logger.hpp:77
fc::logger _log

◆ set_program_options()

static void sysio::trace_api_common_impl::set_program_options ( appbase::options_description & cli,
appbase::options_description & cfg )
inlinestatic

Definition at line 104 of file trace_api_plugin.cpp.

104 {
105 auto cfg_options = cfg.add_options();
106 cfg_options("trace-dir", bpo::value<bfs::path>()->default_value("traces"),
107 "the location of the trace directory (absolute path or relative to application data dir)");
108 cfg_options("trace-slice-stride", bpo::value<uint32_t>()->default_value(10'000),
109 "the number of blocks each \"slice\" of trace data will contain on the filesystem");
110 cfg_options("trace-minimum-irreversible-history-blocks", boost::program_options::value<int32_t>()->default_value(-1),
111 "Number of blocks to ensure are kept past LIB for retrieval before \"slice\" files can be automatically removed.\n"
112 "A value of -1 indicates that automatic removal of \"slice\" files will be turned off.");
113 cfg_options("trace-minimum-uncompressed-irreversible-history-blocks", boost::program_options::value<int32_t>()->default_value(-1),
114 "Number of blocks to ensure are uncompressed past LIB. Compressed \"slice\" files are still accessible but may carry a performance loss on retrieval\n"
115 "A value of -1 indicates that automatic compression of \"slice\" files will be turned off.");
116 }
Here is the caller graph for this function:

Member Data Documentation

◆ compression_seek_point_stride

uint32_t sysio::trace_api_common_impl::compression_seek_point_stride = 6 * 1024 * 1024
staticconstexpr

Definition at line 171 of file trace_api_plugin.cpp.

◆ manual_slice_file_value

int32_t sysio::trace_api_common_impl::manual_slice_file_value = -1
staticconstexpr

Definition at line 170 of file trace_api_plugin.cpp.

◆ minimum_irreversible_history_blocks

std::optional<uint32_t> sysio::trace_api_common_impl::minimum_irreversible_history_blocks

Definition at line 167 of file trace_api_plugin.cpp.

◆ minimum_uncompressed_irreversible_history_blocks

std::optional<uint32_t> sysio::trace_api_common_impl::minimum_uncompressed_irreversible_history_blocks

Definition at line 168 of file trace_api_plugin.cpp.

◆ slice_stride

uint32_t sysio::trace_api_common_impl::slice_stride = 0

Definition at line 165 of file trace_api_plugin.cpp.

◆ store

std::shared_ptr<store_provider> sysio::trace_api_common_impl::store

Definition at line 173 of file trace_api_plugin.cpp.

◆ trace_dir

boost::filesystem::path sysio::trace_api_common_impl::trace_dir

Definition at line 164 of file trace_api_plugin.cpp.


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