#include "timemory/components/network/components.hpp"
|
static constexpr size_t | data_size = cache::network_stats::data_size |
|
Definition at line 44 of file components.hpp.
◆ base_type
◆ data_array_type
◆ iface_map_type
◆ string_array_type
◆ this_type
◆ value_type
◆ network_stats() [1/5]
tim::component::network_stats::network_stats |
( |
std::string |
_interface | ) |
|
|
inline |
Definition at line 127 of file components.hpp.
128 : m_interfaces{ std::move(_interface) }
◆ network_stats() [2/5]
tim::component::network_stats::network_stats |
( |
std::vector< std::string > |
_interfaces | ) |
|
|
inline |
Definition at line 131 of file components.hpp.
132 : m_interfaces{ std::move(_interfaces) }
◆ network_stats() [3/5]
tim::component::network_stats::network_stats |
( |
| ) |
|
|
default |
◆ ~network_stats()
tim::component::network_stats::~network_stats |
( |
| ) |
|
|
default |
◆ network_stats() [4/5]
tim::component::network_stats::network_stats |
( |
const network_stats & |
| ) |
|
|
default |
◆ network_stats() [5/5]
tim::component::network_stats::network_stats |
( |
network_stats && |
| ) |
|
|
default |
◆ data_array()
◆ description()
std::string tim::component::network_stats::description |
( |
| ) |
|
|
inlinestatic |
Definition at line 99 of file components.hpp.
101 return "Reports network bytes, packets, errors, dropped";
◆ description_array()
Definition at line 286 of file components.hpp.
288 return cache::network_stats::data_descriptions();
◆ display_unit_array()
Definition at line 280 of file components.hpp.
282 return cache::network_stats::data_display_units();
◆ get()
◆ get_display()
std::string tim::component::network_stats::get_display |
( |
| ) |
const |
|
inline |
Definition at line 205 of file components.hpp.
207 auto&& _get_display = [](
const int64_t& _val,
const std::string& _lbl,
209 std::stringstream ss;
221 auto _disp = cache::network_stats::data_display_units();
222 auto _labels = cache::network_stats::data_labels();
223 std::stringstream ss;
225 ss <<
", " << _get_display(_val.get_data()[i], _labels[i], _disp[i]);
226 return ss.str().substr(2);
tim::mpl::apply< std::string > string
static short get_precision()
static fmtflags get_format_flags()
cache::network_stats value_type
data_array_type get() const
References data_size, get(), tim::component::base< Tp, Value >::get_format_flags(), tim::component::base< Tp, Value >::get_precision(), and tim::component::base< Tp, Value >::get_width().
◆ get_interfaces()
std::vector< std::string > & tim::component::network_stats::get_interfaces |
( |
| ) |
|
|
inlinestatic |
Definition at line 136 of file components.hpp.
140 static std::vector<std::string> _instance{};
147 auto _update_instance = []() {
149 for(
auto&& itr :
delimit(_value,
" ,\t;"))
151 if(itr !=
"." && itr !=
"..")
152 _instance.emplace_back(std::move(itr));
156 if(_instance.empty())
165 for(
auto&& itr : utility::filesystem::list_directory(
"/sys/class/net"))
167 if(itr !=
"." && itr !=
"..")
168 _instance.emplace_back(std::move(itr));
170 if(_instance.empty())
172 std::stringstream _ss;
173 for(
const auto& itr : _instance)
175 _value = _last = _ss.str().substr(2);
179 else if(_last != _value)
char argparse::argument_parser tim::settings * _settings
TIMEMORY_SETTINGS_KEY("SUPPRESS_PARSING")) TIMEMORY_SETTINGS_MEMBER_DEF(bool
ContainerT delimit(const std::string &line, const std::string &delimiters="\"',;: ", PredicateT &&predicate=[](const std::string &s) -> std::string { return s;})
arg_result get(size_t _idx, Tp &_value)
static settings * instance()
References tim::_settings, tim::delimit(), tim::argparse::argument_parser::get(), tim::settings::instance(), and tim::TIMEMORY_SETTINGS_KEY().
Referenced by start().
◆ label()
std::string tim::component::network_stats::label |
( |
| ) |
|
|
inlinestatic |
◆ label_array()
Definition at line 274 of file components.hpp.
276 return cache::network_stats::data_labels();
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ record() [1/2]
Definition at line 105 of file components.hpp.
107 if(_interface.empty())
108 return cache::network_stats{};
110 return cache::network_stats{ _interface };
Referenced by sample(), start(), and stop().
◆ record() [2/2]
Definition at line 114 of file components.hpp.
116 if(_interfaces.empty())
117 return cache::network_stats{};
118 cache::network_stats _data{};
119 for(
const auto& itr : _interfaces)
122 _data += cache::network_stats{ itr };
◆ sample()
void tim::component::network_stats::sample |
( |
| ) |
|
|
inline |
◆ start()
void tim::component::network_stats::start |
( |
| ) |
|
|
inline |
◆ stop()
void tim::component::network_stats::stop |
( |
| ) |
|
|
inline |
◆ unit_array()
Definition at line 268 of file components.hpp.
270 return cache::network_stats::data_units();
◆ data_size
constexpr size_t tim::component::network_stats::data_size = cache::network_stats::data_size |
|
staticconstexpr |
The documentation for this struct was generated from the following file: